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
amid [387]
3 years ago
15

Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in

one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list. For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered.
Computers and Technology
1 answer:
notsponge [240]3 years ago
3 0

Answer:

count = 20

i = 0

short_strings = []

long_strings = []

while(i<count):

   s = input("Enter a string: ")

   

   if s == "ZZZ":

       break

   

   if len(s) <= 10:

       short_strings.append(s)

   elif len(s) >= 11:

       long_strings.append(s)

   

   i += 1

choice = input("Enter the type of list to display [short/long] ")

if choice == "short":

   if len(short_strings) == 0:

       print("The list is empty.")

   else:

       print(short_strings)

else:

   if len(long_strings) == 0:

       print("The list is empty.")

   else:

       print(long_strings)

Explanation:

*The code is in Python.

Initialize the count, i, short_strings, and long_strings

Create a while loop that iterates 20 times.

Inside the loop:

Ask the user to enter a string. If the string is "ZZZ", stop the loop. If the length of the string is smaller than or equal to 10, add it to the short_strings. If the length of the string is greater than or equal to 11, add it to the long_strings. Increment the value of i by 1.

When the loop is done:

Ask the user to enter the list type to display.

If the user enters "short", print the short list. Otherwise, print the long_strings. Also, if the length of the  chosen string is equal to 0, print that the list is empty.

You might be interested in
Personal computer is the rise of what?​
gogolik [260]

Answer:

Overuse injuries of the hand.

Obesity.

Muscle and joint problems.

Eyestrain.

Behavioural problems including aggressive behaviour.

6 0
3 years ago
Please read !!!
prisoha [69]
Don’t stress. You’re no failure if you believe in yourself. Have some faith. Don’t give up and live your life to the fullest. Take care and stay safe!! :)
3 0
3 years ago
If you want a language that is relatively easy to write and which can be tested easily as it's being developed, you would choose
Oksi-84 [34.3K]

Answer:

true

Explanation:

because it needs a interpreter so that it could be more developed

3 0
3 years ago
What methods could you use to set up printing in an organization?
shutvik [7]

The used to set up printing in an organisation are as follows;

  • Connecting directly to the printer
  • setting up a print server
  • using a cloud service to set up printers.

<h3>Method for printing in organisation.</h3>

There are different method for setting up printing in an organisation.

They include the following;

  • Connecting directly to the printer : directly connecting a printer; From small to large organizations, you have lots of ways to set up a printer.
  • setting up a print server
  • using a cloud service to set up printers. There are numerous cloud service that could render this service like goggle.

learn more on printing here: brainly.com/question/14668983

#SPJ11

3 0
2 years ago
An end user has reported not receiving emails sent by a specific customer. Which of the following is the MOST likely cause of th
dedylja [7]

An end user has reported not receiving emails sent by a specific customer. The main reason for this is The email filter has quarantined the messages

<u>Explanation:</u>

A location on the server the emails that are considered as spam gets stored. These are stored in this location only on a temporary basis. They can be retrieved whenever necessary.  The System administrator has the authority to check the emails that are suspected to be spam on behalf of the user.

Using End User Digest any user can find those emails that are quarantined and can take necessary actions on these emails. The emails are stored in this location only for a certain period of time. If the time is exceed then those mails will be deleted automatically

5 0
3 years ago
Other questions:
  • To maintain audience interest in a multimedia presentation, use animations or transition features to control when objects or tex
    13·1 answer
  • Which interest bearing account is best for people who won’t need access to their money for several months or longer?
    6·1 answer
  • Write a recursive method in pseudo code that returns the number of 1's in the binary representation of n. use the fact that this
    6·1 answer
  • A tower or mini tower pc is a type of all- in -one unit true or false
    9·2 answers
  • PLEASE HELP I mainly only need the answer for 4.
    5·1 answer
  • This is your code.
    9·1 answer
  • SOMEONE PLEASE HELP ME WITH THIS PLEASE HELP ME PLEASE!!!!!!
    6·1 answer
  • . Question 2 Fill in the blank: R Markdown notebooks can be converted into HTML, PDF, and Word documents, slide presentations, a
    9·1 answer
  • Can someone please help me! It’s due Thursday!
    13·1 answer
  • What does data warehousing allow organizations to achieve?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!