🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X
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:

  1. Input: Prompts the user for a number and converts it to an integer.
  2. Condition: Checks if the number is divisible by 2.
  3. Output: Prints "Even" if true, otherwise prints "Odd".
Report an error

Meanwhile you can watch this video

Watch Video
Latest Updates