if nScores > 0: aScore = score[nScores - 1] nScores -= 1 # do something with the removed score if nNames > 0 aName = name[nNames - 1] : nNames -= 1 # do something with the removed name if nStudents > 0: aStudent = student[nStudents - 1] nStudents -= 1 # do something with the removed object