9. More with 'for' | Wrong sorting


My code sorts the numbers wrong and I don't know why/how. Error message says "Oops, try again. It looks like square_list has 25 at index 3 instead of 16"

I expected it all to work but couln't figure it out. Please Help!

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

# Your code here!
for x in start_list:

print square_list


you sort before appending to list, you should sort after appending

if you want to do it even better, sort after the for loop so that sorting only happens once rather then each iteration


Ok, thank you, really helped me understanding everything much better