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