0
How to create a string ?
Complete the code to create a string containing a double quote.
3 Answers
0
d="\""
s = d+'text'+d
print (s)
0
str = "\"text\""
Here \ is the escape character - it wont print and it helps to avoid problems when inserting quotes inside the string
0
In Python there's a more readable way.
The different sets of quotes are exchangeable. So when you need ', you write
print("abc'def")
and when you need ", you write
print('abc"def')