Python Program to Check if a Number is Odd or Even
Python Program to see if a Number is Odd or Even |
|
CODE | OUTPUT |
# Python program to see if the input number is odd or maybe . # variety is albeit division by 2 provides a remainder of 0. # If remainder is 1, it’s odd numbernum = int(input(“Enter a number: “))if (num % 2) == 0: print(“{0} is Even”.format(num)) else: print(“{0} is Odd”.format(num)) |
Enter a number: 4343 is Odd
Enter a number: 1818 is Even
|
In this program, we ask the user for input the value and check if the number is odd or even |