Question: using python please evaluate to get an outcome equals 2 4 when entering: initialPopulation = 1 0 , rateOfGrowth = 1 . 2 , hours

using python please evaluate to get an outcome equals 24 when entering: initialPopulation=10, rateOfGrowth=1.2, hours=4 instead of 29.8598839
initialPopulation = int(input("Enter the initial number: "))
rateOfGrowth = float(input("Enter the growing rate (A Number greater than 1): "))
hours = int(input("Enter the number of hours: "))
totalHours = int(input("Enter the total hours of growth: "))
resulting = initialPopulation
for i in range(hours, totalHours +1, hours):
resulting *= rateOfGrowth
print ("The total population is", resulting)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!