Step-by-step explanation:
I have provided the code below which is producing the correct answers. Answers are verified by actual answers from calculator.
I have used a for loop for fast calculation and print.
ANSWER CODE:
population = 312032486;
seconds = 365*24*60*60;
births = seconds//7;
deaths = seconds//13;
immigrations = seconds//45;
years = {1,2,3,4,5}
change_in_pop = births - deaths + immigrations;
for val in years:
new_population = population + val*(change_in_pop)
print("The population after " + str(val) + " years is " + str(new_population)+"\\")