if __name__ == '__main__':标签:__,说谎,逻辑运算,wang,zhang,python,li,----,Li From: https://www.cnblogs.com/feihujiushiwo/p/18182987
Li = [0, 1]
for a in Li:
for b in Li:
for c in Li:
zhang = (b == 0)
li = (c == 0)
wang = (a+b == 0)
if (zhang+li+wang == 2 and a+b+c == 2) or (zhang+li+wang == 1 and a+b+c == 1):表示3个人中1个人说谎或者两个人说谎
if a == 1:
zhang = '真话'
else:
zhang = '假话'
if b == 1:
li = '真话'
else:
li = '假话'
if c == 1:
wang = '真话'
else:
wang = '假话'
print('zhang说的话是:', zhang)
print('li说的话是:', li)
print('wang说的话是:', wang)