+ 3
Python double quotes
Can someone please explain the following? "double quotes cant be directly included in a double string". Thank you.
3 Answers
+ 5
If you want to print the following:
âNo!â, she said.
You cant use:
print(ââNo!â, she said.â)
Because the quotes will mess up with the string. I believe thats what your sentence there means.
But you could use:
print(ââNo!â, she said.â)
Because then Python will know what you want.
+ 3
It goes the same with single quotes. You need to use the escape character backslash '\' on each single or double quote to make it work.
Check this code:
https://code.sololearn.com/cNs0q66noLwf/?ref=app
+ 1
Thank you for your answers.