9. More with 'for' Error: "square_list has 2 at index 0 instead of 1."


#1


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

I get this error code:

"Oops, try again. It looks like square_list has 2 at index 0 instead of 1." I am not sure why 2 would take index 1 because it is the lowest number in the square_list. The error confuses me. Could someone please help?


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

for num in start_list:
    square_list.append(2 ** num)
    square_list.sort()

print square_list


#2

I found the error, thanks anyways!


#3