def generator(): nums = [\'09\', \'98\', \'87\', \'76\', \'65\', \'54\', \'43\'] s_chars = [\'*\', \'&\', \'^\', \'%\', \'$\', \'#\', \'@\',] data =
A properly-placed data.write('\n') will handle that. Just indent it appropriately for the loop you want to punctuate.
data.write('\n')