python - Checking if x>y without if statement -


in python, possible check whether x>y without using if statement?

there variety of ways go this:

print "yes" if x > y else "no" 

or:

print ["no", "yes"][x > y] 

or:

print x > y , "yes" or "no" 

(at least, mind-reading powers think you're doing)


Comments

Popular posts from this blog

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

asp.net mvc 3 - Unexpected "foreach" keyword after "@" character -