SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 = oneyear_sec // 7 # A birth every 7 seconds results in 4505142 births per year
  9. deaths_year = oneyear_sec // 13 # A death every 13 seconds results in 2425846 deaths per year
  10. immigrants_year = oneyear_sec // 35 #A new immigrant every 35 seconds results in 901028 immigrants per year
  11. change_year = births_year + immigrants_year - deaths_year
  12.  
  13. population_est = years_int * ( population_current + change_year)
  14.  
  15. print("Estimated population in", years_int, "year(s) is: ", population_est)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top