Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- budget = int(input())
- total = 0
- command = input()
- while command != "Stop":
- total = 0
- for letter in command:
- total += ord(letter)
- if budget >= total:
- budget -= total
- print(f"Item successfully purchased!")
- else:
- print(f"Not enough money!")
- break
- command = input()
- if command == "Stop":
- print(f"Money left: {budget}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement