I have two code snippets which essentially do the same thing. Here are the two samples :
retval = count or num_element > 0
and
if count or num_element > 0 :
retval = True
else:
retval = False
Is there any specific reason the first option is preferred over the second? I know that people have their own choices. But I am curious to know if there are any performance or other implications. I feel second way is more readable.