Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- print("This program estimates the population variation within a desired country")
- birth_rate = 1/20 # a birth every 20 seconds
- death_rate = 1/13 # a death every 13 seconds
- immigrants_rate = 1/35 # an immigrant every 35 seconds
- emigrants_rate = 1/60 # am emigrant every 60 seconds
- initial_population = int(input("Input the initial population: "))
- print("Initial population: ", format(initial_population, ',.0f'))
- estimation_period_years = int(input("Input the estimation period: "))
- estimation_period_seconds = estimation_period_years * 365 * 24 * 60 ** 2
- print("Population growth: ", format(estimation_period_seconds * (immigrants_rate + birth_rate - death_rate
- - emigrants_rate), ',.0f'))
- final_population = initial_population + estimation_period_seconds * (immigrants_rate + birth_rate - death_rate
- - emigrants_rate)
- print("Final population: ", format(final_population, ',.0f'))
- if initial_population > final_population:
- print("It is a demographic decline!")
- else:
- print("It is a demographic rise!")
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement