Advertisement
Spocoman

Summer Shopping

Oct 7th, 2023
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. budget = float(input())
  2. towel = float(input())
  3. discount = int(input())
  4.  
  5. umbrella = towel / 3 * 2
  6. flip_flops = umbrella * 0.75
  7. beach_bag = (towel + flip_flops) / 3
  8.  
  9. sum = (towel + umbrella + flip_flops + beach_bag) * (100 - discount) / 100
  10.  
  11. if budget >= sum:
  12.     print(f"Annie's sum is {sum:.2f} lv. She has {budget - sum:.2f} lv. left.")
  13. else:
  14.     print(f"Annie's sum is {sum:.2f} lv. She needs {sum - budget:.2f} lv. more.")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement