PupilNames=[""]*5
TestMarks=[0]*5
min =TestMarks[0]
max=TestMarks[0]
min=1
for index in range(5):
PupilNames[index]=str(input("Please enter the pupil's name: "))
TestMarks[index]=int(input("Please enter the test mark: "))
if TestMarks[index] >max:
max=TestMarks[index]
else:
min=TestMarks[index]
print(PupilNames[index],"got the highest mark which was",max)
print(PupilNames[index],"got the lowest mark which was",min)
如果我输入字母 ae 作为他们的名字和数字 1-5 作为值,它会打印出 e 得到最高值和最低值,但是数字是正确的,5 是最高的,1 是最低的