Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

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

Database Processing Fundamentals Design And Implementation

Authors: KROENKE DAVID M.

1st Edition

8120322258, 978-8120322257

More Books

Students also viewed these Databases questions

Question

Define Scientific Management

Answered: 1 week ago

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago

Question

What is meant by Non-programmed decision?

Answered: 1 week ago