Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 1. четем дестинации до получаване на команда End
- destination = input() # държава или "End"
- # стоп: destination == "End"
- # продължаваме: destination != "End"
- while destination != "End":
- # държава
- price_trip = float(input())
- # спестява
- available_money = 0 # наличните пари
- # стоп: available_money >= price_trip
- # продължава: available < price_trip
- while available_money < price_trip:
- saved_money = float(input())
- available_money += saved_money
- else: # available_money >= price_trip -> отивам на екскурзия
- print(f"Going to {destination}!")
- destination = input()
Advertisement
Add Comment
Please, Sign In to add comment