def cube(number): return number^3 print cube(2) I would expect cube(2) = 8, but instead I'm getting cube(2) = 1
What am I doing wrong?
^ is the xor operator.
** is exponentiation.
2**3 = 8
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With