为什么python在下面的代码中显示(32 == 0)
当我测试以下代码时给出了一个奇怪的结果
while not stop:
results = pyautogui.locateAllOnScreen('background data/test.png', confidence = 0.9)
print(len(list(results)))
print(len(list(results)) == 0)
if len(list(results)) == 0:
print('exit loop')
break
Run Code Online (Sandbox Code Playgroud)
上面代码的结果是
32
True
exit loop
Run Code Online (Sandbox Code Playgroud)
len(list(results))
给出 的输出32: int
,但与 比较时0: int
,返回 True
python ×1