Answers for "check odd in python"

12

how to check if a number is odd python

num = int(input("Enter a number: "))  
if (num % 2) == 0:  
   print("{0} is Even number".format(num))  
else:  
   print("{0} is Odd number".format(num))  
Posted by: Guest on May-21-2020
0

python odd or even

n = int(input("Enter a number: "))
print(["even","odd"][n % 2])
Posted by: Guest on August-05-2021

Python Answers by Framework

Browse Popular Code Answers by Language