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