latest_questions = [] for x in range(15): latest_questions.append(x) print latest_questions latest_questions.append('over') print latest_questions if len(latest_questions) > 15: latest_questions.pop(0) print latest_questions
Standard input is empty
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 'over'] [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 'over']