Hi,
I'm curious about a few conventions.
If you have a function that can return a or b based on some conditionals, which do you think is the best/accepted notation?
def test(val):
if val > 10:
return a
else:
return b
Or
def test(val):
if val>10:
return a
return b
I often see both of these conventions used and wondered what you guys would recommend. Additionally, I commonly see these dual notations:
if x==True:
do stuff
VS
if x:
do stuff
Is there a preferred convention in this case?
Thanks.