Answered step by step
Verified Expert Solution
Question
1 Approved Answer
why is it not working for ans = num_doublings(27, 28) print(ans) how do make it work for all :) the population to go from a
why is it not working for
ans = num_doublings(27, 28)
print(ans)
how do make it work for all :)
the population to go from a given initial size to a value greater than or equal ta a given final size. The answer should be zero if the final population is less than or equal to the initial population. Note: Your function must use a while laap, not a mathematical farmula far the result. For example: \begin{tabular}{|l|l|} \hline Test & Result \\ \hline ans = nun_doublings( (1,8) & 3 \\ print(ans) & \\ \hline \end{tabular} Answer: (penalty regime: 0% ) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 ef num_doublinas(initial_nooulation, final_pooulation): num_numedoublina' if final_population c- initial_population: number return nutber count = b initial_population =1 while initial_population \& final_population: initial_population = initial_population 2 caunt +=1 return count Seratehpad 21ans=numdoublinas(27,28)print(ans) Prefix with Answer One or more hidden tests failedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started