+ 6
How do you create a string with a double quote?
14 Answers
+ 16
\" is used to create string containing double quote
+ 11
print("The program printed, \"Hello, World!\".")
+ 4
\'' is for double quote and for single quote is \'..
+ 4
Just include it in the string, but make sure the string is single quote delimited. Example: print('Hello "World"')
+ 4
In python, I prefer to use single quote ' for string, so whenever I want add double quote ", just add it normaly, it looks simpler. we also can do it vice versa. however, you also need to know to use the traditional \ for special character.
+ 3
print "He said:\"This is how\"."
+ 2
you can print the double quote surrounded by single quotes or the other option is to use the scape character \.
Example:
with single quote: '"hello"'
with scape character: \"hello\"
+ 1
Have a read about escape characters. just type backslash \ right before the " you want add to the string
+ 1
use \" for
use \n for new line and \a for a beeb (usefull to nitify errors within program )
0
escape sequences are used
they are combination of characters following \
to print " \"is used
0
there is a prob. by typing a \' to create a string with a double quote
0
what is the difference between double and single qoute
0
use \s for it
it will print what ever is written within brackets.
- 5
use three quotes """ hi hello world """"