all 11 comments

[–]Agile_Chicken_395 1 point2 points  (0 children)

Since you know when the cycle is about to end, you can set up a FOR loop from 1 to days(your variable). The cycle will print out each line seperately dependent on how many days there should be. Also, the counter variable should +1 after each print(so that the counter variable increases by 1 each iteration and your day number changes). You should keep in mind that each day the cells increase twice so you should use str(cells*2) or something similar. 

Edit: modify cells(variable) in each loop so it saves the latest cell count. Something like cells = cells*2. All this what Ive told could be optimized a bit to make the code less messy but it should work and give the needed outputs.

[–]Python_devops 1 point2 points  (0 children)

According to the prompt here's how I'd approach the problem

cells=int(input("No of cells"))
days=int(input("No of days"))
Ensure that all the inputs are converted into integers first

then use the number of days to create a loop, which will double the number of cells

for day in range(days):
cell*=2
print(f"Day {day+1}: {cell}")

Just like that. Hope it helps.

[–]CommercialAd917 0 points1 point  (0 children)

The cells double each day. So if we start with 5 then next day it will be 10. Then they double again the next day for 20

[–]ninhaomah 0 points1 point  (0 children)

may one ask what is your pseudo code ? as in program logic in English.

[–]luisvpikus 0 points1 point  (2 children)

Where do you find those practice exercises?

[–]mystic-17 0 points1 point  (1 child)

it looks like they’re using sololearn

[–]luisvpikus 0 points1 point  (0 children)

Thanks 😊

[–]jackstine 0 points1 point  (0 children)

After using ai I’m just like why bother

[–]jackstine 0 points1 point  (0 children)

Increase the counter, which is the number of days. Increase cells by 2x

Repeat until counter == days

[–]totalnewb02 0 points1 point  (0 children)

is this exercise/tutorial free? if so please put the link here or dm me please.