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
Write a class named Taxicab that has three **private** data members: one that holds the current x-coordinate, one that holds the
Licemer1 [7]

Answer:

See explaination

Explanation:

class Taxicab():

def __init__(self, x, y):

self.x_coordinate = x

self.y_coordinate = y

self.odometer = 0

def get_x_coord(self):

return self.x_coordinate

def get_y_coord(self):

return self.y_coordinate

def get_odometer(self):

return self.odometer

def move_x(self, distance):

self.x_coordinate += distance

# add the absolute distance to odometer

self.odometer += abs(distance)

def move_y(self, distance):

self.y_coordinate += distance

# add the absolute distance to odometer

self.odometer += abs(distance)

cab = Taxicab(5,-8)

cab.move_x(3)

cab.move_y(-4)

cab.move_x(-1)

print(cab.odometer) # will print 8 3+4+1 = 8

7 0
3 years ago
The number 68 is increased to 73. What is the percentage by which the number was increased, to the nearest tenth of a percent?
Ipatiy [6.2K]
Correct answer should be 1.1%
7 0
2 years ago
Read 2 more answers
What is the purpose of a fax cover sheet?
Deffense [45]
A fax cover sheet is the first sheet that gives all the information that is needed.
8 0
3 years ago
Given the variables costOfBusRental and maxBusRiders of type int , write an expression corresponding to the cost per rider (assu
Liono4ka [1.6K]

Answer:

       int costOfBusRental;

       int maxBusRiders;

       int costPerRider;

       costPerRider = costOfBusRental/maxBusRiders;

Explanation:

The costPerRider is the total cost of renting the bus (costofBusRental) divided by all the bus users (maxBusRiders). So we declare the three variables to be of type int as required by the question.

7 0
3 years ago
What does Boot Partition mean?
lukranit [14]

Answer:The system partition and the boot partition are computing terms for disk partitions of a hard disk drive or solid-state drive that must exist and be properly configured for a computer to operate. There are two different definitions for these terms: the common definition and the Microsoft definition. - Wikipedia.

Explanation:

8 0
3 years ago
Other questions:
  • A one-to-many binary relationship allows an occurrence of the entity type on the "one side" of the relationship to be associated
    5·1 answer
  • How can a network design project benefit from the principles of itsm? How might itsm impede a network design project?
    11·1 answer
  • What is the purpose of ergonomics in the workplace? A.Keep workers safe and injury free
    5·2 answers
  • Name three types of data stored on a computer’s hard disk
    11·1 answer
  • Jack is writing a paragraph for a school assignment. He proofreads his paper and notices that he used the word, "then" many time
    15·2 answers
  • How can you tell that a spreadsheet was saved as a 2007 Excel file?
    7·1 answer
  • Where must virtualization be enabled for VM (virtual machine) software to work?
    14·1 answer
  • Complete the sentence.<br> A ___ number is composed of only zeros and ones.
    8·1 answer
  • Consider the security of a mobile device you use
    6·1 answer
  • Project light with a system of lenses used for projecting slides or film into a screen.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!