Wednesday, October 1, 2014

Python - exception avoidance

m1 = []
m2 = None
m1_total = m1 and max(m1) or None
m2_total = m2 and min(m2) or 0


No comments: