More with 'for'


#1

I am currently working on lesson 9 and it gives me the following error:

Oops, try again. Your code looks a bit off. Check the Hint if you need help! Your code threw the following error: invalid syntax (python, line 5)

This is my code:

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

for number in start_list
square_list.append(number ** 2)

square_list.sort()

print square_list

Not sure what I am doing wrong here.

Currently messing with the formatting for this post, there is a tab under the for section.


#2

Check your indentation within your for loop. Similar to If statements, subsequent lines should be indented.

Let me know if that helps.


#3

Yeah the spacing is there, just cant seem to get it to show on this.


#4

Can you post a link to the exercise?


#5

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


#6

Just saw another item which could be causing an issue--make sure to add a colon on your for loop. Sorry, I missed that initially.


#7

THANK YOU! I knew I had to be missing something like that.


#8

Yea definitely, Happy I could help!


#10