Are newlines sometimes required at end of Python code?

Chris Ryland cpr at emsoftware.com
Fri Mar 31 16:04:02 EST 2000


I'm no language expert, but I think the parser
requires an EOL at the end of any compound statement.
--
Cheers!
/ Chris Ryland, President / Em Software, Inc. / www.emsoftware.com
- - -
"Edward C. Jones" <edcjones at erols.com> wrote in message
news:38E505D9.61F2AB05 at erols.com...
> Why does this piece of code work:
>
> s~=~"""for~i~in~range(3):\n~~~~x~=~i\n"""
> exec~s
>
> while this one doesn't:
>
> s~=~"""for~i~in~range(3):\n~~~~x~=~i"""
> exec~s
>
> I have replaced all the spaces in the code by "~".
>
>





More information about the Python-list mailing list