Python Program to Check Whether Number is Even or Odd Using Conditional Operator

This Python program checks whether a given number by user is even or odd using Conditional Operator.

Python Source Code: Even or Odd Using Conditional Operator


# Check Even or Odd Using Conditional Operator

number = int(input("Enter number: "))

print("ODD") if number%2 else print("EVEN")

Output

Run 1:
---------------	
Enter number: 11
ODD.

Run 2:
---------------	
Enter number: 24
EVEN