Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- money = float(input())
- year_live = int(input())
- years = 18
- for i in range(1800, year_live + 1):
- if i % 2 == 0:
- money -= 12000
- years += 1
- else:
- money -= (12000 + years * 50)
- years += 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
Advertisement