我试图循环访问数组,跳过某些产品类型。我的问题是它不会跳过它们。无论产品类型是否在跳过列表中,都会发生同样的事情。Python中的多条件IF条件
for i in source:
if (i["product_type"] == 00 and i["product_type"] == 35 and i["product_type"] == 72):
print i["product_name"] + " has been skipped"
else:
# Upload product
你的意思'或',而不是'和'?毫无疑问,product_type只能是一件事,它不能同时是00,35和72。 – nos 2014-12-02 12:44:33