0% found this document useful (0 votes)
293 views3 pages

Santileces - 07 Task Performance1 - ProgLang

The document provides instructions to create a Python program that calculates the hourly count of bacteria given an initial count and number of hours. Bacteria replicate through binary fission every 20 minutes, doubling the population each generation. The program should prompt the user for the initial count and hours, then output the bacteria count for each hour by using the exponential growth equation and a generation time of 20 minutes. A sample output is provided.

Uploaded by

ash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
293 views3 pages

Santileces - 07 Task Performance1 - ProgLang

The document provides instructions to create a Python program that calculates the hourly count of bacteria given an initial count and number of hours. Bacteria replicate through binary fission every 20 minutes, doubling the population each generation. The program should prompt the user for the initial count and hours, then output the bacteria count for each hour by using the exponential growth equation and a generation time of 20 minutes. A sample output is provided.

Uploaded by

ash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Santileces, Rosse Anne S.

BSIT3A-2

Programming Languages

07 Task Performance 1 – ARG

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.

Upload the .py file and a screenshot of your output.


Sample output::

Enter initial count of bacteria: 5


Enter the number of hours: 2
The number of bacteria per hour will be:
Hour 1 = 64
Hour 2 = 128
Hour 3 = 192
Hour 4 = 256
Hour 5 = 320

USING PYTHON: SYNTAX

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))

You might also like