def cube(number): return number^3 print cube(2)
I would expect cube(2) = 8, but instead I'm getting cube(2) = 1
cube(2) = 8
cube(2) = 1
What am I doing wrong?
^ is the xor operator.
^
** is exponentiation.
**
2**3 = 8