I am new to Python and i jumped right into python 3. However i am trying to use the learning practices from pyschools.com. I have run into a question that deals with using strings. They want this result: "No, thanks, Mom," I said, "I don't know how long it will take.". In Python 3 I can just type this out literal using the """ before and after. however in Python 2 that same line comes out as \'"No, thanks, Mom," I said, "I don\'t know how long it will take."\'. How do I format this correctly?
I am new to Python and i jumped right into python 3. However i
Share
There is no problem; your python interpreter is echoing the string back to you in a manner that can be pasted back into the interpreter.
Use
print()instead if you want to just print the string value instead of the string literal:Note that there is no difference between python versions in that regard; python 3 behaves in exactly the same manner.