Question: python 1.) Write a function called print word that has two parameters. The first is an integer (assume it will always be non negative). The


python
1.) Write a function called print word that has two parameters. The first is an integer (assume it will always be non negative). The second is a string. Print the string on the given number of lines, each time preceded by a line number and an arrow. See the examples below for the format of the output i.e. if you call your function with the same arguments as in the examples your output should look like the output in the examples). The code executed is in blue, the output produced is in green): print_word (3, "banana') 1 --> banana 2 --> banana 3 --> banana print word(4, 'mississippi') 1 --> mississippi 2 --> mississippi 3 --> mississippi 4 --> Mississippi 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: after 20 minutes: after 30 minutes: after 40 minutes: after 50 minutes: 2 bacteria 4 bacteria 8 bacteria 16 bacteria 32 bacteria bacteria (21, 3) after 21 minutes: after 42 minutes: after 63 minutes: 2 bacteria 4 bacteria bacteria
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
