for product in products:
for dess in peice:
for cell in sell:
try:
if product == dess:
print(123)
else:
if product == sell:
print(456)
else:
print(nothing)
except:
pass
我尝试使用if来运行这种for循环。但是如果第一个陈述 然后从循环中退出,不显示任何结果。你能检查一下是什么吗 问题?
答案 0 :(得分:0)
for product in products:
for dess in peice:
for cell in sell:
try:
if product == dess:
print(123)
break
if product == sell:
print(456)
else:
print(nothing)
except:
pass