#A program that reads in the name, id, and a couple grades for a list of students print "Enter students names" #You have to create each list before you can use it nameList = [] name = raw_input("Name: ") while name != "": nameList.append(name) name = raw_input("Name: ") idList = [] gradeList = [] #Loop through each element in the nameList for name in nameList: id = raw_input("Enter " + name + "'s id: ") idList.append(id) grades = [] grade = float(raw_input("Enter their first grade: ")) grades.append(grade) grade = float(raw_input("Enter their second grade: ")) grades.append(grade) gradeList.append(grades) #Loop by index and print out all the info for each student, formatted quite poorly #gradeList contains lists as elements, so to access the inner lists' elements we need to supply two indexes for index in range(len(nameList)): print nameList[index] + " " + idList[index] + " " + str(gradeList[index][0]) + " " + str(gradeList[index][1]) #print out the lists just to illustrate their contents at the end print print print nameList print idList print gradeList