Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

fastest way to check odd or even in python

>>> def isodd(num):
        return num & 1 and True or False

>>> isodd(10)
False
>>> isodd(9)
True
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #fastest #check #odd #python
ADD COMMENT
Topic
Name
3+3 =