Check Even or Odd in Python

This program checks if a given number is even or odd.

 
number = int(input("Enter a number: "))
if number % 2 == 0:
    print(f"{number} is even.")
else:
    print(f"{number} is odd.")

No comments:

Post a Comment

Lists in Python

Introduction: In the realm of Python, lists stand as one of the most versatile and widely used data structures. A list is an ordered, muta...

Post Count

Loading...