GroZnik81

novo!!!

Dec 17th, 2020 (edited)
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. import math
  2. monney_need = float(input())
  3. months = int(input())
  4. end_months_monney = 0
  5. # current_monney = 0
  6. total_money = 0
  7. for every_month in range(1,months+1):
  8.  
  9.     if every_month == 1:
  10.         end_months_monney += monney_need * 0.25
  11.         continue
  12.     elif every_month %  2 != 0:
  13.  
  14.         end_months_monney -= end_months_monney * 0.16
  15.     elif every_month % 4 == 0:
  16.  
  17.         end_months_monney += end_months_monney * 0.25
  18.  
  19.     end_months_monney += monney_need * 0.25
  20.  
  21. if end_months_monney > monney_need:
  22.     total_money = end_months_monney - monney_need
  23.     print(f"Bravo! You can go to Disneyland and you will have {total_money:.2f}lv. for souvenirs.")
  24. else:
  25.     total_money = end_months_monney - monney_need
  26.     print(f"Sorry. You need {abs(total_money):.2f}lv. more.")
  27.  
Add Comment
Please, Sign In to add comment