这里面的 x=not x啥意思呀。意思是x=not时输出x true时输出no 是吗怎么连问号也不能打
正确的缩进应该如下: x为假时,else上面二行都执行不到,所以只输出 no
x = not x 这是逻辑非运算,真的变假,假的变真。 x为真时,先输出yes, x取非后while只能运算一次,然后执行else后的,输出 no
x = 0 while(x): print('yes') x = not x else: print('no')