Python double quotes | Sololearn: Learn to code for FREE!


Python double quotes

Can someone please explain the following? "double quotes cant be directly included in a double string". Thank you.

2/24/2018 11:12:38 PM


3 Answers

New Answer


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.


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:


Thank you for your answers.