Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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 < limit :
- max_price = next_price
- # Read the next price
- next_price = float(input ("Enter a price or 0 to stop:"))
- if max_price > 0 :
- print("Largest number :-",max_price)
- else :
- print("Invalid")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement