Quantcast
Channel: The Crazy Programmer
Viewing all articles
Browse latest Browse all 761

Python Program to Check Number is Odd or Even

$
0
0

Here you will get python program to check number is odd or even.

A number is even if it is completely divisible by 2 otherwise it is odd.

The modulus operator % is used to find remainder of any number. So here we will use it to divide a number by 2 and find the remainder. If remainder is 0 then number is even otherwise odd.

Python Program to Check Number is Odd or Even

num = int(input("enter a number: "))

if(num%2 == 0):
	print("number is even")
else:
	print("number is odd")

Output

enter a number: 11
number is odd

Comment below if you have any queries related to above python odd even program.

The post Python Program to Check Number is Odd or Even appeared first on The Crazy Programmer.


Viewing all articles
Browse latest Browse all 761

Trending Articles