Contents

## Python Program to Check if Number is Even

To check if given number is even or not in Python, we can divide the given number by 2 and find the remainder. If the remainder is equal to zero, then the given number is even, or else not.

If `n`

is given number, then the boolean condition to check if `n`

is even is

`n % 2 == 0`

## Example

In the following program, we take an integer value in `n`

, and check if this number is even or not.

**Python Program**

```
n = 10
if ( n % 2 == 0 ) :
print(f'{n} is even number.')
else :
print(f'{n} is not even number.')
```

Run ## Summary

In this tutorial of Python Examples, we learned how to check if a given number is an even number or not.

## Related Tutorials

- How to Get Number of Axes in Pandas DataFrame?
- How to Swap Two Numbers in Python?
- Python – Factorial of a Number
- Python – Sum of First N Natural Numbers
- Python – Smallest of Three Numbers
- How to Get Number of Elements in Pandas DataFrame?
- Reverse a Number in Python
- Python – Largest of Three Numbers
- Python – Check if Number is Armstrong
- Numpy sqrt() – Find Square Root of Numbers