+ 1
How do I solve this practice exersice? (Python)
PRACTICE EXERCISE Imagine you are a scientist looking at a new type of cell under the microscope. This type of cell divides itself into 2 daughter cells every 24 hours, meaning that the cell population duplicates every day. Task Complete the code to take the initial cell population and the number of days you are observing the cells to calculate the cell population at the end of each day in the following format # take the initial cell population as input cells = int(input()) # take the number of days as input days = int(input()) # initialize the day counter counter = 1 #complete the while loop while : # Daily message print("Day " + str(counter) + ": " +str(cells)) counter = I really don't have good ideas how do I solve it.
1 Réponse
+ 3
The count of one cell is 2ⁿ after n days.
so for one cell:
2¹ = 2 after 1 day
2² = 4 after 2 days
2³ = 8 after 3 days
2⁴= 16 after 4 days ...
now you have more than one cell, so...?