Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cost = float(input())
- months = int(input())
- saved = 0
- for j in range(1, months + 1):
- if j >=0 and j <= 2:
- colected = cost * 0.25
- saved += colected
- if j % 2 != 0 and j != 1:
- spent = saved * 0.16
- saved -= spent
- if j % 4 == 0 and j !=0:
- colected = saved * 0.25
- saved += colected
- if j >= 3:
- colected = cost * 0.25
- saved += colected
- if saved >= cost:
- print(f'Bravo! You can go to Disneyland and you will have {(saved - cost):.2f}lv. for souvenirs.')
- else:
- print(f'Sorry. You need {(cost-saved):.2f}lv. more.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement