newList = []
num = 0
while num < 3:
name = input("请输入一个同学的名字:")
age = input("请输入年龄:")
newDict = {}
newDict["姓名"] = name
newDict["年龄"] = age
newList.append(newDict)
num += 1
print("列表中有如下三个同学:")
for each in newList:
print("姓名 {}".format(each['姓名']))
print("年龄 {}".format(each['年龄']))
print("********************")