Gayantha Akalanka Gayantha Akalanka - 3 months ago 12
Python Question

Please explain the output of this python code

Here the code.

a=False
if a==True or True:
print "Hell yeah,I'm genius"
else:
print "shit,I am a fool"


Output is '
Hell yeah,I'm genius
'

Answer

Anything True , it will run that section ...

if True:

   print "Hell yeah,I'm genius"

else:

   print "shit,I am a fool"

This one also returns "Hell yeah,I'm genius"