Python (beginner) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python (beginner)

#The provided code stores the value 7 in a variable, and outputs it. #Change the code to output the value of the variable raised to the power of 3. num = 7 del num num = 3 print(num) Could someone explain me what is the problem please?

17th Feb 2022, 12:49 PM
StefanFocht
StefanFocht - avatar
7 Answers
+ 7
Raised to the power of 3 means, that variable is multiplied by 3 times itself. In other words, 3 to the power of the variable.
17th Feb 2022, 12:56 PM
Simba
Simba - avatar
+ 3
Thanks a lot ❤️
17th Feb 2022, 2:11 PM
StefanFocht
StefanFocht - avatar
+ 2
print(7**3)
17th Feb 2022, 11:46 PM
TAKOUMBE André
TAKOUMBE André - avatar
0
You need to use operator **, which raises the number to the power. num = 7 print(num**3)
17th Feb 2022, 1:58 PM
Yulia
Yulia - avatar
0
😂🤭
17th Feb 2022, 2:10 PM
StefanFocht
StefanFocht - avatar
0
🤦🏻‍♂️
17th Feb 2022, 2:10 PM
StefanFocht
StefanFocht - avatar
0
😫😱😰😓😯🥴🤤🙂😃
18th Feb 2022, 11:27 PM
ASIM FARHEEN ❄️⚡⚡🤳⚡⚡❄️
ASIM FARHEEN ❄️⚡⚡🤳⚡⚡❄️ - avatar