This is more verbose than it needs to be. Since there's just one use of the variable and it's immediately returned you should just directly check the truthiness of your all(...) statement and return incorrect if the first return doesn't go through