Advertisement
Guest User

Untitled

a guest
Feb 14th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. legacy_money = float(input())
  2. year_to_be_lived = int(input())
  3. y = 18
  4. sum = legacy_money
  5.  
  6. for i in range(1800,year_to_be_lived):
  7. if i % 2 == 0:
  8. legacy_money = legacy_money - 12000
  9. # y+=1
  10.  
  11. if i % 2 == 1:
  12. legacy_money = legacy_money - (12000 + y *50)
  13. y +=1
  14.  
  15. if legacy_money > 0 :
  16. print(f"Yes! He will live a carefree life and will have {legacy_money:.2f} dollars left.")
  17. else:
  18. print(f"he will need {-(legacy_money):.2f} dollars to survive.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement