Advertisement
simeonshopov

Summer Shoping (late july exam)

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