String Formatting with %, Part 2


#1

For string formatting with % part 2 , may i know the purpose of \ between the strings "Ah, so your name is %s, your quest is %s" and "and your favourite colour is %s" ? I tried to remove the \ between both of the strings and from what i can see, there are no identifiable differences in the response that the interpreter provides.


#2

\ is for the programmer, it allows you to put your code on two lines:

print "hello world"
print "hello \
world"

#3

Ah i see i see. Very informative, thank you!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.