Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Python

What is the output of this Print ( 8 **(1/3))

10th Mar 2021, 1:11 PM
Siem Ermias
Siem Ermias - avatar
4 Answers
- 1
You can check it in playground to know output.. ** is Exponentiation operator.
10th Mar 2021, 1:19 PM
Jayakrishna 🇮🇳
- 1
I already know the answer is 2.0 but i need if someone can help me to explain that how?
10th Mar 2021, 1:22 PM
Siem Ermias
Siem Ermias - avatar
- 1
Mathematically =>8^(1/3)=>(2^3)^(1/3) =2^(3/3) =2^1 =2. here, 2^3 means 2 power 3. Result you get always a float type value so 2.0
10th Mar 2021, 1:26 PM
Jayakrishna 🇮🇳
- 1
If you print out what you wrote in your question and havn’t assign Print with a function, you will get a NameError. I you mean to call Pythons built-in function you have to write it with lower case letters: print().
10th Mar 2021, 1:44 PM
Per Bratthammar
Per Bratthammar - avatar