Created
July 18, 2014 17:01
-
-
Save ericmjl/d8650e4337a3ddf40fd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
In response to Stack Overflow question: http://stackoverflow.com/questions/24830029/python-less-greater-than-issue#24830029 | |
""" | |
def batpower(power): | |
if power >= 70: | |
return "good" | |
elif power <= 70 and power > 30: | |
return "ok" | |
elif power <= 30: | |
return "critical" | |
""" | |
It is critical to consider all cases explicitly where feasible. This comes from the zen of Python. | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment