def generator():
nums = [\'09\', \'98\', \'87\', \'76\', \'65\', \'54\', \'43\']
s_chars = [\'*\', \'&\', \'^\', \'%\', \'$\', \'#\', \'@\',]
data =
As other answers gave already pointed out, you can do it by appending a '\n' to c+n
or by using the format string "%s%s\n".
Just as a matter of interest, I think it would be more pythonic to use a list comprehension instead of two nested loops:
data.write("\n".join("%s%s"%(c,n) for c in s_chars for n in nums))