# solution compliments of Craig Davis, with a few changes by Dr. V import random colleges = ["Allegheny", "Bates", "Bucknell", "Carleton", "Colby", "Colgate", "Denison", "Dickinson", "Drew", "Gettysburg", "Hamilton", "Holy Cross", "Kalamazoo", "Kenyon", "Macalester", "Middlebury", "Muhlenberg", "Skidmore", "St. Lawrence", "Trinity", "Vassar", "Wesleyan", "Wheaton", "Wooster"] rankings = [] for j in range (0,24): # One could also type randint(0,23-j) below as well. position = random.randint(0,len(colleges)-1) rankings.append(colleges[position]) del colleges[position] for k in range (0,24): print " ", k+1, " ", rankings[k] school = raw_input("Enter the name of a school: ") if school in rankings: position = rankings.index(school) rankings.remove(school) rankings.insert(position-1,school) for k in range (0,24): print " ", k+1, " ", rankings[k] # Note that the above code uses a "fancy" command # rankings.index(school) to ascertain the position of # the school within the list. Here is a more basic # way to accomplish the same task. school = raw_input("Enter the name of a school: ") if school in rankings: for j in range(0,24): if school == rankings[j]: position = j # Then continue as before.