Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curr_destination_name = input()
- curr_destination_min_price = float(input())
- is_num = False
- is_min_price = False
- curr_saved_money = 0
- curr_money_to_add = 0
- #Will assume that every Destination/Min Budget iteration is separate, with no carry over of previous saved money
- while True:
- command = input()
- is_num = command.isnumeric()
- if is_num == False:
- if command == "End":
- break
- else:
- curr_destination_name = command
- else:
- if is_min_price == False:
- curr_money_to_add = float(command)
- curr_saved_money += curr_money_to_add
- if curr_saved_money >= curr_destination_min_price:
- print(f"Going to {curr_destination_name}!")
- is_min_price = True
- curr_saved_money = 0
- else:
- curr_destination_min_price = float(command)
- is_min_price = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement