I'm a beginner with python and I'm trying to write a program that asks the user for how many classes they have taken, then asks them for the class codes and prints the classes they have left to take.
I can get the program to run perfectly for one list but the trick is there are 3 lists. I made listA the computer science courses which has to print with a header of "part A requirements" and then print each item in the list on a separate line.
The part I am stumped on is removing items from the other separate lists all from one user input, and then printing each list showing what requirements are left for each.
def main():
print "This program returns a list of classes you still have to take: "
classlistA = ["CMSC 201", "CMSC 202", "CMSC 203", "CMSC 304", "CMSC 313",
"CMSC 331", "CMSC 341", "CMSC 345", "CMSC 411", "CMSC 421",
"CMSC 441"]
classlistB = ["MATH 151", "MATH 152", "MATH 221"]
classlistC = ["STAT 334" ,"STAT 451"]
classname = input ("How many classes have you taken so far?: ")
for i in range(classname):
classname = raw_input("Please type the classes you have taken <CODE><COURSE-NUMBER>: ")
classlistA.remove(classname)
print "part A requirements"
for x in classlistA:
print "You still have to take", x
main()