Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 failed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Explain the purpose of pro forma financial statements.

Answered: 1 week ago

Question

Explain the various collection policies in receivables management.

Answered: 1 week ago

Question

What are the main objectives of Inventory ?

Answered: 1 week ago

Question

Explain the various inventory management techniques in detail.

Answered: 1 week ago