Question: Just a quick questions, I'm having issues with the output of the program as it does not give me the desire output def rrecursive(pop,n,r,K): if
Just a quick questions, I'm having issues with the output of the program as it does not give me the desire output
def rrecursive(pop,n,r,K): if n==1: return pop else: popu=rrecursive(pop,n-1,r,K) y= popu+r*(1-popu/K)*popu if y>9.9: print("It will take",n*10,"years for the population to reach 9.9 billion") return 0 return y print(rrecursive(7,40,0.11,10)) It currently prints: It will take 340 years for the population to reach 9.9 billion
0.0
I want the "0.0" to be gone. I tried doing it myself but I'm unable to solve it. I've also tried removing print statement from the function call it did worked but when tried to put in (5,40,0.11,10) it printed nothing
I even tried this but it still didnt work
x=r recursive(7,40,0.11,10)
print(x)
Also once you have figured that out please try to put in (5,40,0.11,10) and see of it actually works. thanks so much
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
