Computer Science, asked by swapnilsinha49, 6 months ago

Fill in the missing lines of code in the following code.the code reads in a limit. You can assume that all prices and the limit are positive numbers. When a price is 0 is entered the program terminates and prints the largest price that is less than the limit.

#Read the limit

limit=float (input("enter the limit"))

max_price=0

#Read the next price

next_price=float(input("enter a price or 0 to stop:"))

While next_price>0:

?
#Read the next price
?

if max_price>0:

?
else:
?

Answers

Answered by JagadeepNayak
4

# Solution Code

#Read the limit

limit = float(input(“Enter the limit”))

max_price = 0

# Read the next price

next_price = float(input(“Enter a price or 0 to stop:”))

while next_price > 0 :

if next_price > max_price and next_price 0: # this block can be used to print max_price before breaking out of the loop

if next_price == 0:

print(max_price)

else:

pass # no code required here

Answered by karunyaemerson
1

Answer:

90

80

70

60

Explanation:

till 60 it's less that 50 so it turns true then it turns false

Similar questions