New answers tagged


If you only care about falsy-ness (which is often the case): if all((x, y, z)): ...


You want to make sure all expressions satisfy a condition. The Python builtin all is made precisely for that. Since we have no need to introduce a new variable name, here I'll use the name _, which is a valid Python name and is the convention for a "throw-away" variable. all(_ is None for _ in (x,y,z))

Top 50 recent answers are included