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
What block cipher mode of operation uses the most basic approach where the plaintext is divided into blocks, and each block is t
Orlov [11]

Answer:

Electronic Code Book

Explanation:

5 0
3 years ago
1. Write an application that prompts the user to enter the size of the side of a square, and then displays a hollow square of th
belka [17]

Answer:

import java.util.Scanner;

public class HollowSquare

{

public static void main(String args[])

{

Scanner scan = new Scanner(System.in);

int size;

System.out.print("Enter the size : ");

size = scan.nextInt();

if(size>=1 && size<=20)

{

for(int i=0; i<size; i++)

{

for(int j=0; j<size; j++)

{

if(i==0 || j==0 || i==size-1 || j==size-1)

System.out.print("*");

else

System.out.print(" ");

}

System.out.println();

}

}

else

System.out.println("Invalid size.");

}

}

4 0
3 years ago
D. Application software are developed by software companies ​
r-ruslan [8.4K]

Answer:

May this help you l think

4 0
3 years ago
Read 2 more answers
For the function below, which variables have the same scope?
steposvetlana [31]

Answer:

numB and power

Explanation:

Correct answer edge 2020

5 0
3 years ago
Read 2 more answers
using the class c ip address 195.1.1.0 (class c means that only the last octet can be used for subnet and host addresses, or sta
Lelechka [254]

Answer:

Explanation:

Given a class C IP address

195.1.1.0

Existing mask is 255.255.255.0

We want to have 12 hosts on 10 subnets.

A class C address has 8 bits of the host which will give, n=8

2ⁿ - 2 = 254 hosts

Current mask= 255.255.255.0

Bits needs for 10 subnets

2ⁿ = 10, n = 4bits

n = 4 = 2⁴ = 16 possible subnets

Now, bit needed for 12host, n =4bits

2⁴-2 = 14 possible host,

Total of 8 bits needed so therefore we can use as 4bits for the subnet.

So we could have

4 bit subnet and 4 bits hosts

11110000 = 240decimals

Final possible masks is

255.255.255.240

5 0
3 years ago
Other questions:
  • Write a statement that defines an ifstream object named inputFile and opens a file named "Friends.txt".
    13·1 answer
  • When your phone sends/receives text messages (specifically using SMS), the total data sent/received contains more than just your
    8·2 answers
  • To display a pop-up form for a control, such as account number in a datasheet create a user interface (UI) macro that is associa
    12·1 answer
  • A __________ is an entity that manages the use, performance, and delivery of cloud services, and negotiates relationships betwee
    6·1 answer
  • #include
    7·1 answer
  • To override a method in a subclass, the method must be defined in the subclass using the same signature and compatible return ty
    12·1 answer
  • Write an algorithm for a program which inputs the lengths a, b and c of the three sides of a triangle. The program then determin
    9·1 answer
  • What is string literal in Java?
    5·1 answer
  • In what ways is the human brain like a computer? In what ways is it different?
    14·2 answers
  • Fill in the missing terms relating to computer software
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!