How can we use string in double quotes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

How can we use string in double quotes

9th Jul 2017, 11:27 AM
Abhi
Abhi - avatar
4 Answers
+ 3
I can't understand your question please give a example what you want
9th Jul 2017, 11:33 AM
Akash
Akash - avatar
+ 3
You can use either single or double quotes for strings which contain the other type of quotes inside. However, if a string contains both single and double quotes, one pair has to ve escaped: my_string = 'She said: "Come with me", so I followed her.' my_string2 = "It was her parents' house we were in." my_string3 = "Although everything said \"Don't do it!\" - I had to try doin' it."
9th Jul 2017, 12:44 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
yes you can, ussualy with another pair of quotes or by using the escape character. Though i have programmed in python
9th Jul 2017, 11:50 AM
Claudiu Stefan Haidu
Claudiu Stefan Haidu - avatar
0
didn't get the question
13th Jul 2017, 1:34 PM
paul mwengei
paul mwengei - avatar