What's wrong with this?


#1



This is my exact course I'm stuck on:
https://www.codecademy.com/courses/learn-python/lessons/python-lists-and-dictionaries/exercises/more-with-for?action=lesson_resume


It says, "Make sure not to modify start_list!" But I don't get how I'm modifying it.
Also, when it prints to the console, it prints out "1, 4, 9, 16, 25" so I got it to print the correct numbers, but there's still an error message. Can someone help me??


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

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

square_list.sort()
print square_list


#2

Did you mean to write,

for x in start_list:

?


#3

Thanks, I didn't see that there, also, the error message was actually
"name 'x' is not defined" so that would've helped there, it didn't actually print the numbers there, but thanks!


#4

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