Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. cost = float(input())
  2. months = int(input())
  3. saved = 0
  4.  
  5. for j in range(1, months + 1):
  6.         if j >=0 and j <= 2:
  7.             colected = cost * 0.25
  8.             saved += colected
  9.  
  10.         if j %  2 != 0 and j != 1:
  11.             spent = saved * 0.16
  12.             saved -= spent
  13.  
  14.         if j % 4 == 0 and j !=0:
  15.             colected = saved * 0.25
  16.             saved += colected
  17.         if j >= 3:
  18.             colected = cost * 0.25
  19.             saved += colected
  20.  
  21. if saved >= cost:
  22.     print(f'Bravo! You can go to Disneyland and you will have {(saved - cost):.2f}lv. for souvenirs.')
  23. else:
  24.     print(f'Sorry. You need {(cost-saved):.2f}lv. more.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement