Skip to content

Instantly share code, notes, and snippets.



Created Jul 18, 2014
What would you like to do?
In response to Stack Overflow question:
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