第1关:真伪问题
StuList = ['A', 'B', 'C', 'D']
for stu in StuList:print("若", stu, "同学考了60分")if stu != 'B':print("B同学说了真话")else:print("B同学说了假话")if stu == 'C':print("A同学说了真话")else:print("A同学说了假话")if stu == 'D':print("C同学说了真话")print("D同学说了假话")else:print("C同学说了假话")print("D同学说了真话")num = None #统计有多少人说了真话############ Begin ###########num = (stu != 'B') + (stu == 'C') + (stu == 'D') + (stu != 'D')############ End ###########print("共有", num, "人说了真话")#如果说真话的人数是3,表示考了60分的人是stuif (stu != 'B') + (stu == 'C') + (stu == 'D') + (stu != 'D') == 3:ans = stu
print("综上所述", ans, "同学考了60分")