Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. def main():
  2.  
  3. print("This program estimates the population variation within a desired country")
  4.  
  5. birth_rate = 1/20 # a birth every 20 seconds
  6. death_rate = 1/13 # a death every 13 seconds
  7. immigrants_rate = 1/35 # an immigrant every 35 seconds
  8. emigrants_rate = 1/60 # am emigrant every 60 seconds
  9.  
  10. initial_population = int(input("Input the initial population: "))
  11.  
  12. print("Initial population: ", format(initial_population, ',.0f'))
  13. estimation_period_years = int(input("Input the estimation period: "))
  14. estimation_period_seconds = estimation_period_years * 365 * 24 * 60 ** 2
  15.  
  16. print("Population growth: ", format(estimation_period_seconds * (immigrants_rate + birth_rate - death_rate
  17. - emigrants_rate), ',.0f'))
  18. final_population = initial_population + estimation_period_seconds * (immigrants_rate + birth_rate - death_rate
  19. - emigrants_rate)
  20. print("Final population: ", format(final_population, ',.0f'))
  21.  
  22. if initial_population > final_population:
  23. print("It is a demographic decline!")
  24. else:
  25. print("It is a demographic rise!")
  26.  
  27.  
  28. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement