ron wrote:
> So I'm starting to work my way through Alan's online
> book, reading, then typing in code and seeing it work.
> The following is a snippet of code in the Loops
> section. I'm getting an error message.
>
> Here's the code and error message:
>
>  myList = [1,2,3,4]
>  for index in range(len(myList)):
>     myList[index] += 1
>  print myList
>
>   File "<stdin>", line 3
>     print myList
>         ^
> SyntaxError: invalid syntax
>   

Did you create a new file with this in it, or did you try to type it 
into the interpreter?
Is this exactly what you typed?
> can someone tell me what the syntax error is, and how
> to correct it?
>   
There's nothing wrong with the code.
Let's try to figure out what else it could be.
-Luke
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to