Comparisons give True or False, and and, or and not combine them. Booleans are numbers underneath (True is 1), so sum(flags) counts the True values.
In an if, every value counts as true or false. These are false: 0, 0.0, "", [], {} and None. Everything else is true, including " " (spaces) and "0" (text).
None means "no value yet": a field that was left out, or a function that returns nothing. Test for it with is None, not if not x, because 0 and "" are false too and may be real answers.
Floats are stored in binary, so 0.1 + 0.2 == 0.3 is False. Compare money rounded to the cent, round(a, 2) == round(b, 2), or use math.isclose(a, b).
all(values) is True when every value is true, and any(values) when at least one is.