Question about appending


#1



https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/6?curriculum_id=4f89dab3d788890003000096#


The error message is "Make sure to sort square_list after filling it!"


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

# Your code here!
for item in start_list:
    square_list.append(item **2)
  
print square_list


#2

You need to sort square_list before you print it. You can do this by using the .sort() method.


#3

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