Advertisement
Rahul_Tudu

Sir Zuala assingment

Apr 30th, 2022 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. # Read the limit.
  2. limit = float(input ('enter the limit'))
  3. max_price = 0
  4. #Read the next price
  5. next_price = float(input ("Enter a price or 0 to stop:"))
  6. while next_price > 0 :
  7.     if next_price > max_price and next_price < limit :
  8.         max_price = next_price
  9.     # Read the next price
  10.     next_price = float(input ("Enter a price or 0 to stop:"))
  11. if max_price > 0 :
  12.     print("Largest number :-",max_price)
  13. else :
  14.     print("Invalid")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement