Parentheses in Python function returns: why are they sometimes mandatory and sometimes not? : I'm learning Python and, so far, I absolutely love it. Everything about it. 

I just have one question about a seeming inconsistency in function returns, and I'm interested in learning the logic behind the rule.

If I'm returning a literal or variable in a function return, no parentheses are needed:

> def fun_with_functions(a, b):
>> total = a + b<br>
>> return total

However, when I'm returning the result of another function call, the function is wrapped around a set of parentheses. To wit:

> def lets_have_fun():
>> return(fun_with_functions(42, 9000))

This is, at least, the way I've been taught, using the [A Smarter Way to Learn Python][1] book. I came across this discrepancy and it was given without an explanation. You can see the online exercise [here][2] (skip to Exercize 10).

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?


  [1]: https://www.amazon.com/Smarter-Way-Learn-Python-Remember/dp/1974431479
  [2]: http://asmarterwaytolearn.com/python/50.html