CBSE Class 12 Computer Science
Question 95 of 105
Python Revision Tour — Question 1
Back to all questions 1
Question 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.
x = int(input("Enter x: "))
if x < 0:
print("negative")
elif x > 0:
print("positive")
else:
print("zero")Enter x: -5
negative
Enter x: 0
zero
Enter x: 5
positive