Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Усложняваш си живота, абсолютно излишни са взиманията на дестинация и пари отвън, опитай се да
- # разбереш while True!!!
- # destination = input()
- # needed_money = float(input())
- spend_money = 0
- is_money_enough = False
- while True:
- destination = input()
- if destination == 'End':
- break
- needed_money = float(input())
- # Абсолютно никъде не намаляваш spend_money...Което означава, че като отиде на екскурзия, не харчи пари
- # a както знаеш, безплатни екскурзии няма... За това трябва парите да се намалят!
- while needed_money > spend_money:
- money = float(input())
- spend_money += money
- if needed_money <= spend_money:
- is_money_enough = True
- spend_money = 0
- print(f"Going to {destination}!")
- break
- # Тук винаги ще ти гърми, защото все някога ще получиш END, а след него вместо брейк, имаш needed_money...
- # destination = input()
- # needed_money = float(input())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement