0
How to calculate exponention
Did you know that there are more bacteria cells in your body than cells that make up your body? Weird! A bacteria culture starts with 500 bacteria and doubles in size every hour. Which means, after 1 hour the number of bacteria is 1000, after 2 hours - 2000, and so on. Let’s calculate and output the number of bacteria that will be in the culture after 24 hours
5 odpowiedzi
- 2
PRINT(500*2**24)
BACTERIA DOUBLE EVERY HOURS SO = 500*2 ,AND THE IT IS HAPPEING FOR 24 HOUR S0=500*2**24
FINAL STEP=PRINT(500*2**24)
+ 5
Exponentiation is explained in lesson 5 of the Python for Beginners course. Re-read the lesson
+ 2
Power calculation need is 2**24, =>2 power 24
here ** is 'power of' operator in python.
hope it helps in complete task.
+ 1
Thanks a lot friends
+ 1
You can use ** operator, but be aware with its predence, exponent operator has right to left associativity