9. More with 'for'


This is my code.

start_list = [5, 3, 1, 2, 4]
square_list = []
for number in start_list:
    square_list.append(number ** 2)
print square_list

The error
Oops, try again. square_list should be the same length as start_list

What am I doing wrong?


break means:

Stop right here! You can't loop anymore! I forbid you!!

So it just stops your loop, which means your loop will only run one time.
You should remove this and it should work.


Thanks I figured it out all I had to do was erase the break