1.问题描述:
请用python实现推断小偷是谁?
2.上代码:
for thief in ["a", "b", "c", "d"]:
sum = (thief != "a") + (thief == "c") + (thief == "d") + (thief != "d")
if sum == 3:
print((thief != "a"))
print((thief != "a")+(thief == "c"))
print((thief != "a")+(thief == "c")+ (thief == "d"))
print("小偷是:%s" % thief)
3,执行结果: