Skip to main content
added 123 characters in body
Source Link
Andrew Clark
  • 209.7k
  • 36
  • 285
  • 310

Use implied line continuation by putting everything within parentheses. This is the method recommended in Python's Style Guide (PEP 8):

print ("my name is [%s]" ", I like [%s] " "and I ask question on [%s]" % ("xxx", "python", "stackoverflow")) 

This works because the Python interpreter will concatenate adjacent string literals, so "foo" 'bar' becomes 'foobar'.

Use implied line continuation by putting everything within parentheses. This is the method recommended in Python's Style Guide (PEP 8):

print ("my name is [%s]" ", I like [%s] " "and I ask question on [%s]" % ("xxx", "python", "stackoverflow")) 

Use implied line continuation by putting everything within parentheses. This is the method recommended in Python's Style Guide (PEP 8):

print ("my name is [%s]" ", I like [%s] " "and I ask question on [%s]" % ("xxx", "python", "stackoverflow")) 

This works because the Python interpreter will concatenate adjacent string literals, so "foo" 'bar' becomes 'foobar'.

Source Link
Andrew Clark
  • 209.7k
  • 36
  • 285
  • 310

Use implied line continuation by putting everything within parentheses. This is the method recommended in Python's Style Guide (PEP 8):

print ("my name is [%s]" ", I like [%s] " "and I ask question on [%s]" % ("xxx", "python", "stackoverflow"))