Question: Task 1 : Write a program in the file population.py that takes these inputs and displays a prediction of the total population. please correct this
Task : Write a program in the file population.py that takes these inputs and displays a prediction of the total population.
please correct this code
# Input values
def predictpopulation:
# Get input values
initialpopulation intinputEnter the initial number of organisms:
growthrate floatinputEnter the rate of growth a real number :
timetoachieverate intinputEnter the number of hours to achieve the rate of growth:
totalhours intinputEnter the total hours of growth:
# Calculate the total population
timeperiods totalhours timetoachieverate
totalpopulation initialpopulation growthrate timeperiods
# Display the prediction
printfThe total population is: inttotalpopulation
# Run the program
predictpopulation
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
