Q. Write a program to print one of the words negative ,zero or positive. according to whether variable x is less than 0, 0 or greater than 0 respectively.
You can understand by Watching video :-
Answer :-
x = int (input ("Enter the number : ")) if x > 0: print ("positive number ") elif x == 0 : print ("zero number ") else : print ("negative number ")
Output :-
Enter the number : 53
positive number
>>>
Enter the number : -9
negative number
>>>
Enter the number : 0
zero number
>>>
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )