Python program to check if a number is odd or even
In this example, we will learn how to check if a number is odd or even
If a number is completely divisible by 2 then the number will be called Even. and if we got any reminder then the number will be called Odd.
So to obtain a reminder we use an operator ” % ” called modules. When we divide any number by % (modules) then we will get the reminder.
n = int( input(‘ Enter any number : ‘ ) )
if ( n % 2 == 0):
print(‘{0} is Even Number’.format(n))
else:
print(‘{0} is Odd Number’.format(n))
Output
Enter any number : 20
20 is Even Number
Again Run the program
Enter any number : 15
15 is Odd Number
Python Program to add two numbers
Python program to find Area of Square
Python program to find Area of Triangle
Python program to swap two variables
Python program to convert Celsius to Fahrenheit
Python program to generate Random Number
Python program to convert Miles to Kolometers
Python program to find Largest of 2 numbers
Python program to check if number is Odd or Even
Python program to check if number is Positive Negative or Zero
Python program to check Leap Year
Types of Loop in Python
Python program to check Prime Number
Python program to Calculate Sum of N Natural Numbers
Python program to find sum of All Even Number between 1 to 10
Python program to find sum of All Odd Number between 1 to 10
Python program to check Armstrong Number