Posted By

magicrebirth on 09/16/10


String formatting literal

Versions (?)

String literals that span multiple lines

 / Published in: Python


  1. # Continuation lines can be used, with a backslash as the last character on the
  2. # line indicating that the next line is a logical continuation of the line:
  4. hello = "This is a rather long string containing\n\
  5. several lines of text just as you would do in C.\n\
  6. Note that whitespace at the beginning of the line is\
  7. significant."
  9. print hello

Report this snippet  

You need to login to post a comment.