On Tue, 18 May 2010 11:36:02 pm Dipo Elegbede wrote:
> ples help me figure out what is wrong with this syntax?
>
>
> print('Here are the numbers from 0 to 9')
> for i in the range(10):
>     print(i)
>
> thank you.

Others have already given you the answer, but more important is for you 
to learn *how* to get the answer.

Look at the error message Python prints:

>>> for i in the range(10):
  File "<stdin>", line 1
    for i in the range(10):
                     ^
SyntaxError: invalid syntax


You get a SyntaxError, which tells you that what you've written makes no 
sense to the Python compiler. It also tells you that the error has 
nothing to do with either of the print lines.

Unfortunately Python isn't smart enough to recognise that the problem is 
with "the" rather than "range(10)", but it points you to the correct 
line.



-- 
Steven D'Aprano
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to