Question: 2.) Write a function called bacteria that will print out the number of bacteria in a Petri dish as time goes by. The function has

 2.) Write a function called bacteria that will print out the

2.) Write a function called bacteria that will print out the number of bacteria in a Petri dish as time goes by. The function has two parameters. The first is an integer giving the number of minutes it takes for a bacterium to split into two new bacteria. The second is an integer giving the number of bacterial generations to include in the output. Assume you always begin with a single bacterium in the dish and every bacterium always splits into exactly two bacteria at the end of each time period. Here are some examples of calling the function with different arguments. (The code executed is in blue, the output produced is in green): bacteria (10, 5) after 10 minutes: 2 bacteria after 20 minutes: bacteria after 30 minutes: 8 bacteria after 40 minutes: 16 bacteria after 50 minutes 32 bacteria bacteria (21, 3) after 21 minutes: 2 bacteria after 42 minutes: bacteria after 63 minutes:8 bacteria

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 Databases Questions!