0

#Error in return code

Sorry this is a noob one https://code.sololearn.com/cbY9DvQ7iIZy/?ref=app

27th May 2021, 2:51 PM
mdhb
mdhb - avatar
5 Antworten
+ 4
mdhbl , you need to use print() outside of your function call. ... print(Power (9, 2)) print(Power (9, 1))
27th May 2021, 2:54 PM
Lothar
Lothar - avatar
+ 2
You are getting no output because you have not printed it!! I mean return means to return a value , and for see the output you need the help of print() function. here is the code - https://code.sololearn.com/cUW6kdZuWDaR/?ref=app
27th May 2021, 2:53 PM
Abhiyantā
Abhiyantā - avatar
+ 2
Para ver el resultado primero debes usar la función print(), a continuación te brindó 2 pequeños ejemplo de cómo seria: #option 1 def Power(number, pow=1): """Raise num to the power of pow""" new_value=number ** pow print(new_value) Power (9, 2) Power (9, 1) #option 2 def Power(number, pow=1): """Raise num to the power of pow""" new_value=number ** pow return new_value print(Power (9, 2)) print(Power (9, 1))
27th May 2021, 5:29 PM
Cmurio
Cmurio - avatar
+ 1
If you just try to rectify your last two steps by making it a print command, it will give a damn good output! print(Power(9,2)) print(Power(9,1)) Boom, you are good to go!
28th May 2021, 4:09 PM
Shreyas Kumar
Shreyas Kumar - avatar
0
Thanks everyone.
30th May 2021, 5:42 AM
mdhb
mdhb - avatar