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
STALIN [3.7K]
3 years ago
10

Write a loop that continually asks the user what food the user has in their refrigerator until the user enters apples, in which

case the loop ends. It should acknowledge the user in the following format. For the first food, the user might say "hamburger," so your response would be, "You have a hamburger with a total of 1 food(s) if they enter hamburger, and so on until they enter “apples” at which point the loop ends. ---- make sure you save your file as "may28.py" *
Computers and Technology
1 answer:
almond37 [142]3 years ago
7 0

(Disclaimer: I am not a professional, so it might not be the most concise answer possible, but I did run the Python script and it works)

Answer:

user_input = input("What food do you have in your refrigerator? ").lower()

count = 0

while True:

   if user_input != 'apples':

       count += 1

       print(f'You have a {user_input} with a total of {count} food(s)\n')

       user_input = input("What food do you have in your refrigerator? ")

   else:

       break

You might be interested in
The inside color of text or of an object is called the:
AnnyKZ [126]
Fill color is the answer hope this helps
8 0
3 years ago
8.5 question 2 edhesive
dangina [55]

Answer:

Please check the attachment.

Explanation:

Please check the attachment for the program in python.

Download txt
5 0
3 years ago
How to get an object from a container in java.
Vinil7 [7]
If it stores any type of objects mixed, use Object as storage class. All classes inherit from Object and for primitives use their respective wrapper classes. Or just use one of the bazillion container classes that already exist.
3 0
3 years ago
Simplest way to start baking career is to attend_______.<br><br><br><br>​
ivolga24 [154]
...attend course
I hope my answer helps.
7 0
3 years ago
How do networks help protect data?
klasskru [66]
Network Security. Network Security protects your network from common security threats like viruses, worms, trojans, spyware, adware, identity theft, denial of service attacks and more. To protect yourself you could install an anti-virus/anti-spyware software like Kaspersky or Malwarebytes.
7 0
3 years ago
Other questions:
  • Can your computer become infected with a virus via email
    10·1 answer
  • Why is important to build strong connections
    9·2 answers
  • A large institution, such as a bank, may have thousands of transactions to process in which no user interaction is required; whi
    5·2 answers
  • An internet connection is required to access which type of software?
    5·1 answer
  • 7.) Title text boxes on every slide must be the same format. <br> A. True <br> B. False
    15·2 answers
  • What are the benefits of writing functions that use parameters and return? Try to list at least two.
    12·1 answer
  • Write a function named findmax()that finds and displays the maximum values in a two dimensional array of integers. The array sho
    13·1 answer
  • What blockchain implementation resulted from bitcoin’s rejection of a recommendation to enhance its scripting language support?
    9·1 answer
  • What feature is available to add a suggestion in the margin of someone else's document?​
    15·1 answer
  • Your customer said that understanding the directions is difficult. This is an aspect of
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!