Answer to Question #222931 in Python for raj

Question #222931

A number N is given as input. Write a program to check if N is positive or negative.

N = -12.5. As the value of N is less than 0, the output should be Negative.



1
Expert's answer
2021-08-04T07:35:18-0400
N = float(input())
if N > 0:
    print('Positive')
elif N < 0:
    print('Negative')
else:
    print('Zero')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS