Stuck in an infinite loop in Python



I am stuck in an infinite loop for my Python coding. The title of the lesson is “More with ‘for’” (9/14).
I wrote the following code. Could anyone please help me what’s going on?

start_list = [5, 3, 1, 2, 4]
square_list = []

for number in start_list:

print square_list


This is making the start_list longer and longer so the loop never quits.



This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.