Can you guys explain how to do quotations with"\" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can you guys explain how to do quotations with"\"

String

1st Dec 2021, 8:46 PM
Humaira
7 Answers
+ 2
print("\"I Love Coding\" ") OR without using escape character \ print(' " I Love Coding" ') Note: I put one space at the end of " and before it in second print sentence to recognize single and double qoutes, u can delete it
1st Dec 2021, 8:55 PM
Muhammad Galhoum
Muhammad Galhoum - avatar
+ 1
Humaira I can't see if you have started a Python tutorial, but there is a bug in Sololearn that sometimes causes that, so I will assume you have started a course. Python for Beginners 9.1 has tbe answer for you to review in details "\"" will allow the qote mark to be printed using the escape character
1st Dec 2021, 8:59 PM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Used for ignore any character after it and that character will be printed as it was written
1st Dec 2021, 9:02 PM
Muhammad Galhoum
Muhammad Galhoum - avatar
+ 1
Thank you guys so much I think I got a better understanding of it!!
3rd Dec 2021, 7:07 AM
Humaira
0
Can you explain the main purpose of the escape character?
1st Dec 2021, 8:56 PM
Humaira
0
In strings some characters have special functions in many languages. For example "", which actually denotes the outside of a string. So normally you can't place a " in strings because it would cut off the string at that point. So we use the escape character \ to have that character escape it's standard string function and form part of the string itself. Hope that helps.
3rd Dec 2021, 12:15 AM
Joseph Fruin
Joseph Fruin - avatar
0
In strings some characters have special functions in many languages. For example "", which actually denotes the outside of a string. So normally you can't place a " in strings because it would cut off the string at that point. So we use the escape character \ to have that character escape it's standard string function and form part of the string itself. Hope that helps.
3rd Dec 2021, 12:15 AM
Joseph Fruin
Joseph Fruin - avatar