Suppose, I want to define a two-line (or a multi-line) string.
I can do this in two ways:
\n
"This is the first sentence. \n This is the second sentence."
""" This is the first sentence. This is the second sentence."""
Which is the more efficient or conventional ? Why ?
I'm tempted to say it doesn't matter since each one still scans inside for escaped characters while parsing the text.
>>> print "a\n\tb"
a
b
>>> print """a\n\tb"""
a
b
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments