Python Program to Check if a Number is Odd or Even – Programming Code Examples
Python

Python Program to Check if a Number is Odd or Even1 min read

In this program, we will find whether a given number is even or odd. We have discussed two methods of finding it.

So, firstly we take a number from the user, using the built-in input() function and typecast the return value from input() function into int datatype.




We have used the modulus operator(%) which will give the remainder after dividing the number with 2. And then using the if- else statement we check whether the number is even or odd.

Write a program to Check if a Number is Odd or Even in Python

Code:

Leave a Comment