9. More with 'for'


#1

This is my code.

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

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

What am I doing wrong?


#2

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.


#3

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