• API
• FAQ
• Tools
• Archive
SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 70 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. else:
7.
8. population_current = 307357870
9. oneyear_sec = 365 * 24 * 60 * 60 # 1 year = 365 days = 8760 hours = 525600 minuntes = 31536000 seconds
10. births_year = float(oneyear_sec / 7) # A birth every 7 seconds results in 4505142 births per year
11. deaths_year = float(oneyear_sec / 13) # A death every 13 seconds results in 2425846 deaths per year
12. immigrants_year = float(oneyear_sec / 35) #A new immigrant every 35 seconds results in 901028 immigrants per year
13. change_year = births_year + immigrants_year - deaths_year #2980324 plus per year
14.
15. population_est = population_current + ( years_int * change_year)
16.
17.     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.

Top