Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- money = float(input())
- last_year = int(input())
- year = 18
- for years in range(1800, last_year + 1):
- if years % 2 == 0:
- money -= 12000
- else:
- money -= (12000 + 50 * year)
- year +=1
- if money >=0:
- print(f'Yes! He will live a carefree life and will have {money:.2f} dollars left.')
- else:
- print(f'He will need {abs(money):.2f} dollars to survive.')
Advertisement
Add Comment
Please, Sign In to add comment