Santileces - 07 Task Performance1 - ProgLang
Santileces - 07 Task Performance1 - ProgLang
BSIT3A-2
Programming Languages
Instructions
Bacteria replicate by binary fission, a process by which one bacterium splits into two. Therefore,
the population of bacteria doubles every generation time. Generation time is the time it takes for
a population of bacteria to double in number.
The relationship between the number of bacteria in a population at a given time (Nt), the original
number of bacterial cells in the population (No), and the number of binary fissions those bacteria
have undergone during that time (n) can be expressed by the following equation:
Using your preferred IDE or this online IDE, create a Python program that computes and
displays the hourly count of bacteria with a generation time of 20 minutes given the number of
hours and initial/starting count of the bacteria.
For example, if there are initially 5 bacteria (No = 5), the number of bacteria after 2 hours (Nt)
would be 320. n = 6 because 2 hours are equivalent to 6 times of 20 minutes. See the solution
below.
OUTPUT:
icount = int(input("Enter initial count of bacteria: "))
hrs = int(input("Enter the number of hours: "))
print("The number of bacteria per hour will be: ")
for x in range(5):
n = hrs * 3
n1 = pow(2,n)
print("Hour",x + 1,"=" , str((x+1)*n1))