A bacteria culture starts with 500 bacteria and doubles in size every hour. Which means, after 1 hour the number of bacteria is | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 9

A bacteria culture starts with 500 bacteria and doubles in size every hour. Which means, after 1 hour the number of bacteria is

Im stuck here

25th May 2021, 3:47 AM
Roshan Gaikwad
Roshan Gaikwad - avatar
7 Answers
+ 8
Where's your attempt?
25th May 2021, 3:49 AM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
+ 6
Hi there. You have to review the lesson with exponentiation. To raise a power number in the python language must be used **. So it's simple: they gave you the formula and you must put the N at the power.Replace N with 24 and you will have: N=500*2**24 print(N) But if you don't understand something it's good to review. Good luck!
25th May 2021, 12:53 PM
Cristina
+ 4
Roshan Gaikwad How we would know where you stuck without seeing your code?
25th May 2021, 3:57 AM
A͢J
A͢J - avatar
+ 4
You are stuck? I thought bacteria would have stuck in you! Attempt?
25th May 2021, 5:49 AM
JOKER
JOKER - avatar
+ 3
Your task seem to be easy u need to learn basics of data types and loop suppose in one hours 500 bacteria spreading then after 1 hourse it should be double then for 2 hours it will be 1000 see here its multiplying by 2 use loop how many times u want to execute and inside loop write logic for double
25th May 2021, 4:29 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Hi there. Heres the answer print ( 500 * 2 ** ( 24) )
21st Jul 2021, 9:26 PM
Abdulsalam Qudus
Abdulsalam Qudus - avatar
0
Hi there, Firstly you need to raise the power. As it becomes double after every hour. Total Hours are 24 Now, raise power,, 2 ** 24 Result = 16777216 now, get final result. print(500*16777216) Result 8388608000
7th Feb 2022, 12:28 PM
Abrar Ahmed
Abrar Ahmed - avatar