[Type C] Python Revision Tour-1 – Chapter 1

|
Table of Contents

2. Write a program that returns True if the input number is an even number, False otherwise.

def is_even(num):
    return num % 2 == 0

# Example usage:
num = int(input("Enter a number: "))
print(is_even(num))
Output
Enter a number: 7
False
"Spread the light within, illuminate the hearts around you. Sharing is not just an action, but a sacred journey of connecting souls."~ Anonymous

Leave a Reply

Your email address will not be published. Required fields are marked *