+ 1
Read My Message
We Can Put " instead of ' when you use \ For Example: print("Brian\'s mother: He\'s not the Messiah. He\'s a very naughty boy!") it will be Brian's mother: He's not the Messiah. He's a very naughty boy! instead of Using \
5 Antworten
+ 17
Read It. That should be the correct answer
+ 16
hmmm, ok I've read it, what next? 😃
+ 11
Yes, sssooo.... where's your question?
+ 3
i don't really think i understand your question but the backslash is used to escape the quotes, your string in python and most programming languages are written between those " " quotes so if i were to add an extra quote in my string like this
--> "brians's Mother" i wouldn't get any error cause i have started with a double quote and i have a single quote in-between my string, the only time there is an issue is when i am using a double quote which i had used to start the string in-between my string like this "the "quotes" are issues" the interpreter thinks i am ending my string at that "the " and definitely throws an error
+ 1
You don't need to do \' instead when you use double quotes to enclose your message, if that's what you want to know. But you need to do \" if you need it.