1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vlada [557]
4 years ago
8

Create an array of strings. Let the user decide how big this array is, but it must have at least 1 element. Prompt them until th

em give a valid size. Prompt the user to populate the array with strings Display the longest and shortest string Input an array size for you words array: 5 Now please enter 5 words Input a word: apples Input a word: eat Input a word: banana Input a word: spectacular Input a word: no The longest word is : spectacular The shortest word is : no
Computers and Technology
1 answer:
Brums [2.3K]4 years ago
5 0

Answer:

lst = []

n = int(input("Input an array size for you words array: "))

print("Now please enter " + str(n) + " words")

max = 0

min = 1000

index_min = 0

index_max = 0

for i in range(n):

   s = input("Input a word: ")

   lst.append(s)

   if len(s) >= max:

       max = len(s)

       index_max = i

   if len(s) <= min:

       min = len(s)

       index_min = i

print("The longest word is :" + lst[index_max])

print("The shortest word is :" + lst[index_min])

Explanation:

Create an empty list, lst

Get the size from the user

Create a for loop that iterates "size" times

Inside the loop, get the strings from the user and put them in the lst. Find the longest and shortest strings and their indices using if structure.

When the loop is done, print the longest and shortest

You might be interested in
Mainframe computers have several CPUs, have very fast processor speeds, can supporting multiple operating systems and have huge
Marrrta [24]

Answer:

True.

Explanation:

Mainframe computers were developed and introduced in the early 1950s.

Mainframe computers have several CPUs, have very fast processor speeds, can supporting multiple operating systems and have huge amounts of storage capacity. As a result, mainframe computers are mostly or commonly used by large companies, business firms or governmental institutions for performing various complex tasks such as census, financial transactions, e-commerce, data sequencing, enterprise resource planning, etc.

7 0
3 years ago
Which statement describes what happens if multiple users make changes simultaneously to a presentation when coauthoring?
Marina CMI [18]

Answer:

3.

Explanation:

Co-authoring in PowerPoint is sharing a presentation and allowing your colleagues to work on it at the same time. This option of co-authoring is available when you share or save your file on OneDrive or SharePoint.

The perk of co-authoring a presentation is that PowerPoint keeps a record of all edits under the name of the author. This keeps the conflicts away.

Therefore, the correct answer is option 3.

8 0
3 years ago
Which statement below is incorrect when discussing communication in the online community?
Marysya12 [62]
It's everyone's responsibility to report cyberbullying.

The tone is important whenever you are talking to someone else.

You can literally say anything in virtual world, but you should behave yourself

If everybody knows the common text phrases, then it's fine, but it will be better to talk formally.
8 0
3 years ago
Introduction to numbering system
kirill115 [55]
What about it? I need more details
7 0
3 years ago
Which of the following are true if you pay only the minimum amount each month towards your credit card bill ?
kobusy [5.1K]
Where are the statements so i may help you 
5 0
3 years ago
Other questions:
  • An existing document that you use as a starting point for a new document; it opens a copy of itself, unnamed, and then you use t
    15·1 answer
  • 6 external parts or peripherals of a computer system and identify which are output and which are input devices.
    5·1 answer
  • When determining the amount of RAM necessary for a computer you wish to purchase, what should you consider?
    7·1 answer
  • All file types have unique _____________________ that determine which program to use to open a particular file and to access its
    14·1 answer
  • If your DTP document contains watermarks on every page, where can you place them?
    10·1 answer
  • A section in a history book describing the conditions and causes of the Great Depression in the Midwest in the 1930s. a. Enterta
    15·1 answer
  • 4. What is the formula for calculating the file size?
    11·1 answer
  • Identify the parts of it, Give at least three web browser that you usually used to visit a website.​
    10·1 answer
  • PLEASE HELP I WILL GIVE BRAINLIEST AND 100 POINTS IF U ANSWER COMPLETELY WITHIN 30 MIN
    10·1 answer
  • The lost boy gave the correct
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!