Я работаю над загадкой переменных и не могу понять, как моя переменная меняется с 1 на 0 в процессе ниже:
x = 1
y = 0
# first assignment
x = x^y
print(f'x value is {x} after reassignment')
# x value is 1 after reassignment
# second assignment
y = y^x
print(f'y value is {y} after reassignment')
# y value is 1 after reassignment
print(f'{y} = {y} ^ {x}')
# returns 1 = 1 ^ 1
# x value is now 1 but somehow ZERO after the assignment below
x = x^y
print(f'{x} = {y} ^ {x} how did x become zero from this assignment?')
# returns 0 = 1 ^ 0
Я хочу понять, как этот х стал нулевым.спасибо!