Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. years_int = int(input("Input number of years: "))
  2.  
  3. if years_int < 0:
  4. print("Invalid input!")
  5.  
  6. population_current = 307357870
  7. oneyear_sec = 365 * 24 * 60 * 60 # 1 year = 365 days = 8760 hours = 525600 minuntes = 31536000 seconds
  8. births_year = float(oneyear_sec / 7) # A birth every 7 seconds results in 4505142 births per year
  9. deaths_year = float(oneyear_sec / 13) # A death every 13 seconds results in 2425846 deaths per year
  10. immigrants_year = float(oneyear_sec / 35) #A new immigrant every 35 seconds results in 901028 immigrants per year
  11. change_year = births_year + immigrants_year - deaths_year #2980324 plus per year
  12.  
  13. population_est = population_current + ( years_int * change_year)
  14.  
  15. print("Estimated population in", years_int, "year(s) is: ", population_est)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement