end quote help for a newbie

Zachary Ware zachary.ware+pylist at gmail.com
Thu Jan 30 09:13:17 EST 2014


On Thu, Jan 30, 2014 at 7:26 AM, Peter Clark <artomishka at yahoo.co.uk> wrote:
> There is probably an easy solution to this – but I have not found it.
>
> Trying to terminate a literal in a print statement (from the tutorial).
>
> The literal should be enclosed in double quotes “ “
>
> the initial double quote seems to be OK (if I use a different character it
> flags it) but the ending is flagged as invalid syntax.  I have tried
> changing my keyboard from UK to USA, without any effect, and tried adding a
> space after the final double quote,

Which version of Python are you using?  Make sure you're using the
same version of interpreter and tutorial.  'print' was one of the big
changes between Python 2 and Python 3 (in Python 2 it was a statement,
while in Python 3 it is a function), so a tutorial written with Python
2 in mind will have some issues if you're using Python 3.

If you've already checked that, try copying and pasting your entire
interpreter session into a reply here, and we'll be more able to
figure out what's going on.

Hope this helps,

-- 
Zach



More information about the Python-list mailing list