[Tutor] list iteration question for writing to a file on disk

Shawn Milochik Shawn at Milochik.com
Fri Sep 14 15:59:36 CEST 2007


When you use "print," it automatically adds a newline (\n).

You can avoid this by following the print line with a comma:

print j,

Or rstrip() the line before printing. Either way.



More information about the Python-list mailing list