- 2
How to enclose a double quoted string into a double quoted string?
6 ответов
+ 5
Swethasenthil ,
you can use single quotes as outer quotes, and double quotes for the inner quotes:
print ('The number: "36"')
+ 2
Using double quote inside double quote raise an error similar to single quote. You have to use "\" here .
print("the number is\"36\"")
+ 1
It was like ... print ("The number: "36"") What is the error..
+ 1
This is a very simple fix. If you don't want to use single quotes, then you can use python's escape character, the backslash.
The solution for your example is
print("The number: \"36\"")
You place the backslash directly before the character you want to print. For example, a new line is "\n", a tab is "\t", double quote "\"", single quote "\'".
0
Make use of escape sequences . eg ,
"\" Something\""
0
I can't undestand what you want to say.