allStudentsAAA = ['Bob', 'John', 'Carl', 'Joe', 'Hao', 'Ali'] # Create a set of allStudents allStudentsSet = set(allStudentsAAA) # Create an empty set gradedStudents = set() # Empty set # Fill in the gradedStudents set with people that have grades def whichHaveGrades(): global allStudentsSet, gradedStudents for student in allStudentsSet: answer = raw_input('Does %s have a grade?' %(student)) if answer == 'y': gradedStudents.add(student) def main(): global allStudentsSet, gradedStudents whichHaveGrades() # Display the ones without grades # How? ungraded = allStudentsSet.difference(gradedStudents) print ungraded main()