Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vacation_money = float(input())
- savings = float(input())
- days_count = 0
- spend_count = 0
- while vacation_money > savings:
- command = input()
- money = float(input())
- if command == "spend":
- spend_count += 1
- savings -= money
- if savings < 0:
- savings = 0
- elif command == "save":
- savings += money
- spend_count = 0
- days_count += 1
- if spend_count == 5:
- break
- if vacation_money <= savings:
- print(f"You saved the money for {days_count} days.")
- else:
- print(f"You can't save the money.")
- print(f"{days_count}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement