Toggle navigation
Categories
Discussions
Sign In
Home
›
General
To take part in discussions on talkSFU, please
apply for membership
(SFU email id required).
need help?! comp120
Raptors
September 2008
edited September 2008
in
General
i was wondering if any of you guys know how to print the letter "i" with quotation mark..
>>>print "i"
i
but instead of getting a result of i, i want..
>>>print "i"
"i"
how to do that?
Comments
Ether
September 2008
edited September 2008
You need to 'escape' the quotation marks.
Try print "\"i\""
If you put a \ before the quotes, they'll be printed and not read as part of the python script.
Edit: or you could just print '"i"' using the single quotes on the outside and double quotes on the inside.
Makall
September 2008
edited September 2008
http://www.python.org/doc/2.2.1/ref/strings.html
Raptors
September 2008
edited September 2008
thanks i figured it out
JayDub
September 2008
edited September 2008
RTFM!!
Morro
September 2008
edited September 2008
Hey, I'm in that class, too. :)
Iran1988
September 2008
edited September 2008
:|
schmoey
September 2008
edited September 2008
Yeah, I'm in CMPT120 too right now, with Cukierman lol
Leave a Comment
Home
•
General
Comment As ...
Comments
Try print "\"i\""
If you put a \ before the quotes, they'll be printed and not read as part of the python script.
Edit: or you could just print '"i"' using the single quotes on the outside and double quotes on the inside.