Skip to content

Instantly share code, notes, and snippets.

@ericmjl

ericmjl/batpower.py

Created Jul 18, 2014
Embed
What would you like to do?
"""
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