python double asterik **
I was wondering what the ** in a piece of code was doing
found that it is to the power of
example:
print 2*3 would be 6
but
print 2**3 would be 8 (two to the power of three ie: 2^3)
#pythonnoob
“The caret operator ^
is typically used for a binary XOR operation in languages like C, C++, Java, and so on. It makes sense that Python didn’t want to “go against the flow” of what existing languages already use.”
-empire359 on reddit