Advertisement
exDotaPro

27_july_2019_2_summer_shopping

Jan 5th, 2020
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. budget = int(input())
  2. towel_price = float(input())
  3. discount = int(input())
  4.  
  5. umbrella_price = 2/3 * towel_price
  6. flip_flops_price = 0.75 * umbrella_price
  7. bag_price = 1/3 * (towel_price + flip_flops_price)
  8. total_sum = towel_price + umbrella_price + flip_flops_price + bag_price
  9.  
  10. total_sum -= total_sum * discount / 100
  11. money_left = abs(budget - total_sum)
  12.  
  13. if budget >= total_sum:
  14.     print(f'Annie\'s sum is {total_sum:.2f} lv. She has {money_left:.2f} lv. left.')
  15. else:
  16.     print(f'Annie\'s sum is {total_sum:.2f} lv. She needs {money_left:.2f} lv. more.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement