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
Post a Comment