>>> print("Hello\nWorld!") & >>> print('Hello\nWorld!') | Sololearn: Learn to code for FREE!


>>> print("Hello\nWorld!") & >>> print('Hello\nWorld!')

Is the output differt for these 2 strings? Diference between using single ' n double " ??

4/8/2018 6:10:56 PM


3 Answers

New Answer


No difference. Both single quotes and double quotes work the same. You just have to make sure you use the same ones together i.e. opening and closing a string with either both single, or both double - not mixing them.


I don't see a difference, you can try it yourself: https://code.sololearn.com/c0U6Sz2dF7Vg/?ref=app


The more interesting thing to try is: print('"Hello World"') print("'Hello World'") That way you can use quotation marks in strings without having to use extra break (backslash).