title: Is there any way to get the output in aws sns to print separate lines for every item in the list
body: <p>Ok, so I have this lambda function that appends return_values[whatever] list and that is sent to aws sns with the formatting below, the problem is it separates the list item with commas and not with a desired new line.  Is there a method to get this formatting correct? I've tried the print(*results,sep='\n') but that just comes back as None as print only returns to the console.</p>
  <p>Here's the output:</p>
  <pre><code>Here is a list of EC2 tags that need review.
  Please correct the tags using the approved values list located below
  &lt;insert site here&gt;.
  
  ------------------------------------------------------------------------------------
  Summary of incorrect tags keys and/or values:
  ------------------------------------------------------------------------------------
  Incorrect Tag Keys    :   []
  Incorrect Tag Values  :   ['i-abc has a incorrect builder tag value.']
  
  ------------------------------------------------------------------------------------
  Summary of missing tags keys and/or values:
  ------------------------------------------------------------------------------------
  Missing Tag Keys     :   []
  Missing Tag Values   :   []
  
  ------------------------------------------------------------------------------------
  Summary of unknown values:
  ------------------------------------------------------------------------------------
  Unknown Tag Values   :   [&quot;i-abc has unknown for it's builder tag value.&quot;, &quot;i-def has unknown for it's builder tag value.&quot;, &quot;i-ghi has unknown for it's builder tag value.&quot;]
  
  ------------------------------------------------------------------------------------
  </code></pre>
  <p>Unknown us listed on the same line three times and the goal is to separate the results per line.  The general idea of the code is below, thanks for the assistance.</p>
  <pre><code>def lambda_handler(event, context): 
      reservations = ec.describe_instances().get('Reservations', [])
      return_value = {} #creates empty dictionary#
      return_value['missingtagkeys'] = [] #within return values dictionary, create a missing tag key list#
      return_value['missingtagvalues'] = [] #within return values dictionary, creates a missing tag values key list#
      return_value['incorrecttagkeys'] = [] #within return values dictionary, create a incorrect tag key list#
      return_value['incorrecttagvalues'] = [] #within return values dictionary, create a incorrect tag value list#
      return_value['unknowntagvalues'] = [] #within return values dictionary, create a unknown tag value list# 
  
  
  
      incorrect_keys = return_value['incorrecttagkeys']
      incorrect_values = return_value['incorrecttagvalues']
      missing_keys = return_value['missingtagkeys']
      missing_values = return_value['missingtagvalues']
      unknowng_value = return_value['unknowntagvalues']
      
      email_body = &quot;&quot;&quot;
  
      Here is a list of EC2 tags that need review.  
      Please correct the tags using the approved values list located below  
      &lt;insert site here&gt;.
      
      ------------------------------------------------------------------------------------
      Summary of incorrect tags keys and/or values:
      ------------------------------------------------------------------------------------
      Incorrect Tag Keys    :   {incorrectkeys}
      Incorrect Tag Values  :   {incorrectvalues}
  
      ------------------------------------------------------------------------------------
      Summary of missing tags keys and/or values:
      ------------------------------------------------------------------------------------
      Missing Tag Keys     :   {missingkeys}
      Missing Tag Values   :   {missingvalues}
  
      ------------------------------------------------------------------------------------
      Summary of unknown values:
      ------------------------------------------------------------------------------------
      Unknown Tag Values   :   {unknowngvalues}
  
      ------------------------------------------------------------------------------------
  
          &quot;&quot;&quot;.format(incorrectkeys = incorrect_keys, 
                     incorrectvalues = incorrect_values, 
                     missingkeys = missing_keys, 
                     missingvalues = missing_values, 
                     unknownvalues = unknown_value)  
              
             
      sns_client.publish(
          TopicArn = 'arn:aws:sns',
          Subject = 'Incorrect Tags Detected',
          Message = str(email_body) + str(return_value),
          )
      return return_value
  </code></pre>