title: python displays `\n` instead of breaking a line
body: <p>I wrote a function to create the <code>VALUES</code> part of a SQL query:</p>
  
  <pre><code>def query_values(data_iterator):
      return ',\n'.join('\n({})\n'.format(',\n'.join('"{}"'.format(value) for value in data_row)
                                       ) for data_row in data_iterator
                        ),
  </code></pre>
  
  <p>When I call this function and <code>print</code> the result, I get is:</p>
  
  <pre><code>query_values:
  ('\n("801",\n"printer",\n"barcode printer")\n,\n\n("844",\n"laptop",\n"windows")\n,\n\n("997",\n"printer",\n"barcode printer")\n',)
  </code></pre>
  
  <p>All in one line. Instead of breaking the line, the <code>\n</code> are displayed.</p>
  
  <p>Originally I had one <code>\n</code>, but then I inserted multiple, just to see if they would get displayed.</p>
  
  <p>The second problem was that there are parentheses around the entire thing, which I didn't want.</p>
  
  <p>I was puzzling over the two issues, and I figured the solution for the second one:</p>
  
  <p>I had a comma at the end of the function. The comma caused the function to return a tuple, instead of a single string.</p>
  
  <p>I removed the comma:</p>
  
  <pre><code>def query_values(data_iterator):
      return ',\n'.join('\n({})\n'.format(',\n'.join('"{}"'.format(value) for value in data_row)
                                       ) for data_row in data_iterator
                        )
  </code></pre>
  
  <p>and that fixed <strong>both</strong> problems. The output was now:</p>
  
  <pre><code>query_values:
  
  ("801",
  "printer",
  "barcode printer")
  ,
  
  ("844",
  "laptop",
  "windows")
  ,
  
  ("997",
  "printer",
  "barcode printer")
  </code></pre>
  
  <p>I put the comma back, and the <code>\n</code> were displayed. I removed the comma, and I have multiple lines again.</p>
  
  <p>I have removed extraneous <code>\n</code>, so now I get what I wanted:</p>
  
  <pre><code>query_values:
  
  ("801","printer","barcode printer"),
  ("844","laptop","windows"),
  ("997","printer","barcode printer")
  </code></pre>
  
  <p>So, my code works correctly, but I'm totally confused about the <code>\n</code> characters displayed in the old version of the code. Why was that happening?</p>
  
  <p>UPDATE:
  A couple answers to this question focused on why I was getting a tuple. That's not my question. Why are <code>/n</code> displayed?</p>