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