Ask coding questions

← Back to all posts
Writing program in python
kazib (0)

How to write a python program using if else statement to find factor for a number when even or odd.

Voters
kazib (0)
Comments
hotnewtop
InvisibleOne (3215)

Like this:

for i in range(100):
  if i % 2 == 0:
    print("Number: " + str(i) + " is even")
  else:
    print("Number: " + str(i) + " is odd")