python 求大神解答

2024-12-30 03:55:48
推荐回答(1个)
回答1:

##注意:最左边每个=表示一个空格
stus=[]
n=input('Please input the number of students:')
for i in range(int(n)):
====nm=input("Please input student's name:")
====gd=input("Please input student's gender:")
====stus.append({'name':nm,'gender':gd})
print("{} students'information has been input".format(n))
print(stus)