I have the following code:
line1 = raw_input(\"line 1: \") line2 = raw_input(\"line 2: \") line3 = raw_input(\"line 3: \") print \"I\'m going to write these
It can be done like this as well:
target.write(line1 + "\n" + line2 + "\n" + line3 + "\n")
Assuming you don't want a space at each new line use:
print("I'm going to write these to the file") target.write("%s\n%s\n%s\n" % (line1, line2, line3))
This works for version 3.6