DEV Community

Discussion on: Good and Bad Practices of Coding in Python

Collapse
 
paddy3118 profile image
Paddy3118

The Pythonic way is to exploit the fact that zero is interpreted as False in a Boolean context,

If the test is for conceptually numeric zero then best to test for the number; especially if there are allied tests for different numbers adjacent.