Help me out with this exponentiation | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help me out with this exponentiation

Let's use exponentiation to solve a known problem. You are offered a choice of either $1.000.000 or $0.01 (one penny) doubled every day for 30 days (the resulting amount is doubled every day). Task: Write a program to calculate the amount that will result from the doubling to understand which choice results in a larger amount. Hint: Let's see how exponentiation can be useful to perform the calculation. For example, if we want to calculate how much money we will have on the 5th day, we can use this expression: 0.01*(2**5) = 0.32 dollars (multiply the penny by 2 raised to the power of 5).

27th Dec 2020, 4:12 PM
Yinka Bello
Yinka Bello - avatar
5 Answers
+ 5
#Read the task carefully print ((0.01)*2**30)
27th Dec 2020, 5:04 PM
Simba
Simba - avatar
0
Ok. So please show your attempt.
27th Dec 2020, 4:20 PM
The future is now thanks to science
The future is now thanks to science - avatar
0
My attempt: print (0.01*2)**30)
27th Dec 2020, 4:54 PM
Yinka Bello
Yinka Bello - avatar
0
What is the correct ouput please?
27th Dec 2020, 5:02 PM
Yinka Bello
Yinka Bello - avatar
0
Thanks Simba. You are too good.
27th Dec 2020, 5:05 PM
Yinka Bello
Yinka Bello - avatar