9. More with 'for'


#1

I don't understand what I did wrong.
The code says:

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

But returns error: Make sure to sort square_list after filling it!


#2

start_list = [5, 3, 1, 2, 4]
square_list = []
for num in start_list:
    square_list.append(num**2)
// sort the list here
print(square_list)

see comment in code. You need to sort the list, before displaying it


#3

Thanks. It works now.
-Eli :smiley: