x=0
while x<20:
x+=1
y=x^x
print(y)
So the expected output to be 2,27,256,3125…………. But all it keeps showing is 0 0 0 0.
x=0
while x<20:
x+=1
y=x^x
print(y)
So the expected output to be 2,27,256,3125…………. But all it keeps showing is 0 0 0 0.
^
is bit-wise XOR.
Exponentiation is **
x=0
while x < 20:
x += 1
y = x ** x
print(y)