Can we use '^' for power raising instead of the double star 🌟 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can we use '^' for power raising instead of the double star 🌟

9th Feb 2017, 12:46 PM
Sasank Maragani
Sasank Maragani - avatar
2 Answers
+ 5
Nope, ^ is bitwise xor
9th Feb 2017, 12:51 PM
DotJason
+ 3
You could, if you implement the magic method "__xor__"... Not recommended, though.
9th Feb 2017, 2:28 PM
Álvaro