27**(1/3)the result is 1 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

27**(1/3)the result is 1

24th Jan 2018, 6:57 AM
ERIC KONGLY
ERIC KONGLY - avatar
1 Answer
+ 7
I ran the code and got 3.0, which I think is correct because raising a number to the 1/3 power is the same as taking its cube root and the cube root of 27 is 3. I think you get the float 3.0 because division produces floats. If you use 1//3 then you get 1 for the reason Ace said.
24th Jan 2018, 7:38 AM
David Ashton
David Ashton - avatar