What do These Backslashes Do?


#1

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)|


Why does nothing happen when I press Run?
#2

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)