Python Program to Check Given Number is Positive, Negative or zero

Python Program to Check Given Number is Positive, Negative or zero

Example

number = int(input('Enter the value: '))

if (number == 0):
    print('it is zero.')
else:
    if number > 0:
        print('it is a positive number')
    else:
        print('it is a negative number')

Output:

Enter the value: -52
it is a negative number

Leave a comment