for i in n:
sn = str(input("What is the student's name? "))
sg = eval(input("What is the student's grade? "))
如果您执行此类操作,那么您将如何保留用户的输入并将其存储?
答案 0 :(得分:0)
您可以使用数组:
names = []
grades = []
for i in n:
sn = str(input("What is the student's name? "))
names.append(sn)
sg = eval(input("What is the student's grade? "))
grades.append(sg)