importsysdefcalculate_population_growth(starting_population,percentage_change,aug,population_to_surpass):'''
Calculates the number of years required to surpass a given population size.
'''number_of_years=1percentage_change=percentage_change/100whileTrue:starting_population+=int(starting_population*percentage_change)starting_population+=int(aug)ifstarting_population>=population_to_surpass:returnnumber_of_yearsnumber_of_years+=1iflen(sys.argv)>4:print(str(calculate_population_growth(int(sys.argv[1]),float(sys.argv[2]),int(sys.argv[3]),int(sys.argv[4]))))
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In Python: