Answers for "odd only in python"

2

odd or even in python

n = int(input("Enter a number: "))
print(n,"is Even.") if (n % 2) == 0 else print(n,"is Odd.")
Posted by: Guest on April-16-2021
0

odd or even python

num = int(input("Number: "))
mod = num % 2
if mod == 0:
    print(f"{num} is even")
else:
    print(f"{num} is odd")
Posted by: Guest on December-04-2021

Python Answers by Framework

Browse Popular Code Answers by Language