Answers for "odd number loop in python"

1

python for loop even numbers

for i in range(2,11,2): # range(start, end, step)
  print(i)
Posted by: Guest on May-07-2021
-1

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
Posted by: Guest on September-14-2020

Python Answers by Framework

Browse Popular Code Answers by Language