Illegal literal or not?

Brian Quinlan brian at sweetapp.com
Fri Jan 24 20:01:32 CET 2003


> Is it possible to have Python produce the following literal output in
the
> interactive mode.
> '"Let's try this!", they said.'
> If so what is the Python statement. I've tried several ways
> and can't seem to produce it.  Thanks for the help.

>>> print """'"Let's try this!", they said.'"""
'"Let's try this!", they said.'
>>> print ''''"Let's try this!", they said.\''''
'"Let's try this!", they said.'
>>> print "'\"Let's try this!\", they said.'"
'"Let's try this!", they said.'
>>> print '\'"Let\'s try this!", they said.\''
'"Let's try this!", they said.'







More information about the Python-list mailing list