write a program in Python to take a number from user and check weather a number is odd or even.
Answers
Answered by
10
Explanation:
a=int(input("Enter a number"))
if a%2==0:
print(a,"is Even no")
else:
print(a,"is Odd no")
Please mark it as brainliest answer
Answered by
10
The following codes must be typed in script mode, saved and then executed.
Here, we'll be using the IF - ELSE function. It is a function that decides the result based on a given condition.
It will run the body of the code, only if the condition is true. Otherwise, the 'else' code of the value inputted will be executed.
CODE:
num = int(input("Enter a number:"))
if num%2 == 0:
print("The number entered is EVEN.")
else:
print("The number entered is ODD.")
OUTPUT:
Attachments:
Similar questions