Curious Python Script Command

Curious Python Script Command

Anonymous
Not applicable
932 Views
1 Reply
Message 1 of 2

Curious Python Script Command

Anonymous
Not applicable

As I sat in class, messing around with Python, I tried to do a number to the power of another number. It was only when the two numbers I used did not return how I expected, did I realize that it wasn't how a number to the power of another number worked. I was just curious what this means, and why it returns the way it does.

2^7 returns as 5

 

100^22 returns 114.

 

What function does ^ serve?

0 Likes
Accepted solutions (1)
933 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

You can find an explanation here:

 

https://wiki.python.org/moin/BitwiseOperators

0 Likes