Computer Science
Write a program that returns True if the input number is an even number, False otherwise.
Python
Python Funda
46 Likes
Answer
x = int(input("Enter a number: "))
if x % 2 == 0:
print("True")
else:
print("False")
Output
Enter a number: 10
True
Enter a number: 5
False
Answered By
27 Likes
Related Questions
Is the loop in the code below infinite? How do you know (for sure) before you run it?
m = 3 n = 5 while n < 10: m = n - 1 n = 2 * n - m print(n, m)
Write a program to print one of the words negative, zero, or positive, according to whether variable x is less than zero, zero, or greater than zero, respectively
Write a Python program that calculates and prints the number of seconds in a year.
Write a Python program that accepts two integers from the user and prints a message saying if first number is divisible by second number or if it is not.