Could anybody explain what the backlash do as in |print "Ah, so your name is %s, your quest is %s, "
“and your favorite color is %s.” % (name, quest, color)|
1 Like
Hi @chipplayer31971,
The backslash tells the Python interpreter to ignore the newline character in the code because otherwise it would throw an error, thinking that these two lines are completely separate (and therefore invalid syntax):
print "Ah, so your name is %s, your quest is %s, "
# then,
"and your favorite color is %s." % (name, quest, color)
2 Likes
is there any reason it shouldn’t be formatted like this
“”“Ah, so your name is %s, your quest is %s,
and your favorite color is %s.”“” % (name, quest, color)