def generator(): nums = [\'09\', \'98\', \'87\', \'76\', \'65\', \'54\', \'43\'] s_chars = [\'*\', \'&\', \'^\', \'%\', \'$\', \'#\', \'@\',] data =
Python's print is the standard "print with newline" function.
print
Therefore, you can directly do, if you use Python 2.x:
print >> data, c+n
If you use Python 3.x:
print(c+n, file=data)