write multiple lines to file python in loop code example Example: python how to write code over multiple lines a = '1' \ + '2' \ + '3' \ - '4'