Skip to content

Latest commit

 

History

History
9 lines (9 loc) · 226 Bytes

Find if the number is odd or even.md

File metadata and controls

9 lines (9 loc) · 226 Bytes

A number is said to be even if it is divisible by 2, hence we use the modulo % operation to check for the same

num = int(input("Enter a number"))
if num % 2 == 0:
    print("Even")
else:
    print("Odd")