Hello everyone!
please explain why this code below makes an ‘IndexError: pop from empty list’ ? thanks in advance
all_students = [“Alex”, “Briana”, “Cheri”, “Daniele”, “Dora”, “Minerva”, “Alexa”, “Obie”, “Arius”, “Loki”]
students_in_poetry =
i = len(students_in_poetry)
while i < 6:
student = all_students.pop()
students_in_poetry.append(student)
print(students_in_poetry)