almost but this part is swrong def set(x,p): return x ^ (1 << p) should probably be def set(x,p): return x | (1 << p)
almost but this part is swrong def set(x,p): return x ^ (1 << p) should probably be def set(x,p): return x | (1 << p)