9. More with 'For'


<Below this line, add a link to the EXACT exercise that you are stuck at.>

I’m not understanding what’s wrong with it. I know that it creates a everlasting loop but what do I put to make it not loop forever?

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

for number in start_list:
  square_list.append(number ** 2)
print square_list


the code you posted does not produce an everlasting (infinity) loop, after iterating over all numbers in start_list, the loop exit


wow I look like booboo the fool, I swear it wasn’t letting me pass the section and it was taking forever to like… tell me if i got the code right or wrong which is usually an indicator that the code loops… thanks anyway smh


The code you posted here on the forum worked fine, that is all i can tell you :slight_smile:


A post was split to a new topic: Square_list


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