I'm trying to do a simple test that returns True if any of the results of a list are None. However, I want 0 and '' to not cause a return of True.
list_1 = [0, 1, None, 4] list_2 = [0, 1, 3, 4] any(list_1) is None >>>False any(list_2) is None >>>False As you can see, the any() function as it is isn't being helpful in this context.
anyhappens to beNone" (which, given that it will returnTrueorFalseorraisean exception, will never happen).