Welcome back to the 150 Python Programs: From Beginner to Advanced series.
Today we will learn how to check whether a number is even or odd in Python.
This is one of the most fundamental problems in programming and helps build logic.
๐ง Problem Statement
๐ Write a Python program to check if a number is even or odd.
1️⃣ Method 1 – Using Modulus Operator %
The most common and easiest way.
Output
Odd number
✔ Simple and widely used
✔ Best for beginners
2️⃣ Method 2 – Taking User Input
Make the program interactive.
✔ Works for any number
✔ Real-world usage
3️⃣ Method 3 – Using a Function
Functions make code reusable and clean.
✔ Reusable logic
✔ Clean structure
4️⃣ Method 4 – Using Bitwise Operator
A more advanced and efficient way.
✔ Faster at low level
✔ Used in performance-critical code
๐ฏ Key Takeaways
Today you learned:
- Using % operator to check even/odd
- Taking user input
- Writing reusable functions
- Using bitwise operator &

.png)
