Questions
Write a Python program to find odd and even number.
Last Updated : 12 Mar 2026
Jan 24
Solution:
# Prompt the user to enter a number and convert the input to an integer
num = int(input("Enter any number which you want to check: "))
# Check if the number is even
if num % 2 == 0:
# If the number is divisible by 2, it is even
print("Even")
else:
# If the number is not divisible by 2, it is odd
print("Odd")
OUTPUT:
Enter any number which you want to check 263
odd
Explaination:
This code checks if a number is even or odd:
- Input: Prompts the user for a number and converts it to an integer.
- Condition: Checks if the number is divisible by 2.
- Output: Prints "Even" if true, otherwise prints "Odd".
Meanwhile you can watch this video
Watch Video