0
Cell Growth Explanation
Ended up having to search for the answer on this one. I'm sure there's more than one answer but this works, could someone please walk me through the while loop so I can get a better grasp on what's happening? Thanks # 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 counter < days + 1: cells = cells * 2 # Daily message print("Day " + str(counter) + ": " +str(cells)) counter = counter + 1
2 Answers
0
Hi,
The comments and code here are pretty self-explanatory.
If you do not understand how this code works, you probably lack an understanding of python syntax. I suggest revising relevant lessons.
0
That much is obvious, and I have done so, but I'm still asking someone to walk me through it. Thanks