Check whether a number is positive or negative or zero.

Banu Prakash M
Guvi
Published in
1 min readJul 25, 2019

Problem 1 :

In this problem, you will learn how to check whether a number entered by the user is positive or negative or zero. This problem is solved using nested if…else statement.

Steps :

  1. Get the input from the user.

2. If the given number is equal to zero print (“Zero”) or check the other condition where if the given number is less than zero print(“Negative”).

3. If both the conditions are false will automatically tell that given number is (“Positive”).

Code Snippet for the above program which follows the proper testcase format :

guvi = float(input())if guvi == 0:   print("Zero")elif guvi< 0:   print("Negative")else:   print("Positive")

--

--