- 3

HEY GUYS I AM NEW TO PYTHON and having a problem in string please help me

<<< " " ?and the question is create a string containing a double quote ?

21st Nov 2016, 12:39 PM
birendra
birendra - avatar
3 Answers
0
Strings Some characters can't be directly included in a string. For instance, double quotes can't be directly included in a double quote string; this would cause it to end prematurely. Characters like these must be escaped by placing a backslash before them. Other common characters that must be escaped are newlines and backslashes. Double quotes only need to be escaped in double quote strings, and the same is true for single quote strings. let me show you how to this print("\" \"") done these are called escape sequence in c++
21st Nov 2016, 1:04 PM
veerendra singh
veerendra singh - avatar
0
Complete the code to create a string containing a double quote.
27th Mar 2020, 6:11 PM
Saif Aziz
Saif Aziz - avatar
- 1
if you don't want to use backslashes to escape the double quotes, you can use single quotes instead. this allows the string to contain double quotes. single quoted string -> allow double quotes inside double quoted string -> allow single quotes inside print(' "quoted string" ') print(" 'quoted string' ")
21st Nov 2016, 2:01 PM
asdadasdsaczxc