I was doing some work in python and I typed in ^ instead off ** without thinking and found some confusion as to what ^ does

I did a bit of testing to find:
10^2 = 8
0^2 = 2
-5^2 = -7
11^2 = 9
9^2 = 11
-10^2 = -12
-9^2 = -11

is there any easy definition of ^

It is used for bitwise exclusive or. So 1 ^ 1 = 0 and 0 ^ 0 = 0 and 1 ^ 0 = 1 and 0 ^ 1 = 1.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.