Please tell me the code for exponentiation in python 3 project 1 | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
- 5

Please tell me the code for exponentiation in python 3 project 1

I wrote a code but it doesn't execute

26th Nov 2020, 3:42 PM
MUKKAMALLA LAVANYA
21 Respuestas
+ 15
This is what I did. x = 1.000*0.01 *(2**30) y = 0.01 *(2**30) if x>y: print (x) else: print (y) Hope it helps ūüėä
27th Nov 2020, 5:57 AM
Harold Peter Ssebetta
Harold Peter Ssebetta - avatar
+ 7
x=1000000 y=0.01*(2**30) if x>y: print (x) else: print(y)
12th Jan 2022, 5:42 PM
Mohammad Soltanpour
+ 2
res = 0.01*(2**30) Print(res)
29th May 2021, 3:51 AM
Sarika Phawade
Sarika Phawade - avatar
+ 1
This is the easy answer for me # your code goes here amount = 0.01 day = 0 while True: amount = amount + amount day += 1 if day == 30: break print(amount)
27th Sep 2021, 1:51 AM
Senpai
Senpai - avatar
+ 1
def Exponentiation(day): return 0.01 * (2**day) def main(): day = 30 print(Exponentiation(day)) if __name__ == "__main__": main()
11th Sep 2022, 4:04 PM
ūüĖ•ÔłŹCatana Raul Andrei ūüíĽūü§Ė
ūüĖ•ÔłŹCatana Raul Andrei ūüíĽūü§Ė - avatar
0
Thank you harold Peter It helps me
28th Nov 2020, 12:01 PM
MUKKAMALLA LAVANYA
0
{Try this :[PYTHON03-PROJECT01]} print(0.01*(2**30)) . . . THANK ME LATER.
14th Jun 2021, 1:53 PM
SAMARATHIBAN.R
SAMARATHIBAN.R - avatar
0
Direct do this print(10787318.24)
30th Sep 2021, 1:43 PM
Ashish Mishra
Ashish Mishra - avatar
0
"This is what I did. x = 1.000*0.01 *(2**30) y = 0.01 *(2**30) if x>y: print (x) else: print (y) Hope it helps ūüėä" How come is that the task was talking about 1.000.000, but you used 1.000 as the "x" variable?
7th Jan 2022, 8:55 PM
Andr4s
Andr4s - avatar
0
print(0.01*(2**5))
19th Jan 2022, 3:51 PM
Om Verma
- 1
Show us your code so that we can help you for exponentiation we use ** for example 2**3 = 2√ó2√ó2 2**4 = 2√ó2√ó2√ó2
26th Nov 2020, 3:43 PM
Ayush Kumar
Ayush Kumar - avatar
- 1
Try writing int before inputting Only numbers could be exponentiated not strings A= int(input(.....
26th Nov 2020, 3:47 PM
Alphin K Sajan
Alphin K Sajan - avatar
- 1
Already tried in that way also
26th Nov 2020, 3:47 PM
MUKKAMALLA LAVANYA
- 1
This worked for me.. Note : Split lines while inputting A=int(input('enter num1 :')) print(A) B=int(input ('enter num2 :')) print(B) c=A**B print(c)
26th Nov 2020, 3:52 PM
Alphin K Sajan
Alphin K Sajan - avatar
- 1
Ok
26th Nov 2020, 3:53 PM
MUKKAMALLA LAVANYA
- 1
FOR exponentiation you have to ** just like 2**5 = 32
27th Nov 2020, 8:47 AM
Sayyam Jain
Sayyam Jain - avatar
- 1
res = 0.01*(2**30) print(res)
21st May 2021, 10:49 AM
Kanad Patil
Kanad Patil - avatar
- 1
def gg(): btr=500 time=2 hr=24 print(btr*(time**hr)) gg()
16th Jul 2021, 10:30 AM
PhpJones
PhpJones - avatar
- 2
A=input('enter num') B=input ('enter num') c=A**B print (c)
26th Nov 2020, 3:45 PM
MUKKAMALLA LAVANYA
- 2
I just learned this so pow(yourbase, yourexponent, modulus(which is optional)) so pow(2,2) == 4 that might work
26th Nov 2020, 5:08 PM
madeline
madeline - avatar