title: Best practice for using parentheses in Python function returns?
body: <p>I'm learning Python and, so far, I absolutely love it. Everything about it. </p>
  
  <p>I just have one question about a seeming inconsistency in function returns, and I'm interested in learning the logic behind the rule.</p>
  
  <p>If I'm returning a literal or variable in a function return, no parentheses are needed:</p>
  
  <pre><code>def fun_with_functions(a, b):
      total = a + b
      return total
  </code></pre>
  
  <p>However, when I'm returning the result of another function call, the function is wrapped around a set of parentheses. To wit:</p>
  
  <pre><code> def lets_have_fun():
       return(fun_with_functions(42, 9000))
  </code></pre>
  
  <p>This is, at least, the way I've been taught, using the <a href="https://rads.stackoverflow.com/amzn/click/com/1974431479" rel="nofollow noreferrer" rel="nofollow noreferrer">A Smarter Way to Learn Python</a> book. I came across this discrepancy and it was given without an explanation. You can see the online exercise <a href="http://asmarterwaytolearn.com/python/50.html" rel="nofollow noreferrer">here</a> (skip to Exercize 10).</p>
  
  <p>Can someone explain to me why this is necessary? Is it even necessary in the first place? And are there other similar variations in parenthetical syntax that I should be aware of?</p>
  
  <p><em>Edit: I've rephrased the title of my question to reflect the responses. Returning a result within parentheses is not mandatory, as I originally thought, but it is generally considered best practice, as I have now learned.</em></p>