I want to iterate over a dict and do some calculations with the data. But I don't want NoneType data, else I get an error. So I do this:
sum_value = 0 if values.get("sum", 0) is None else values.get("sum", 0)
Isn't there a better way to do this in Python?