Check whether the given number is positive or not.

In this python if else program, we will check whether the given number is positive or not.

Positive number:
A positive number is any number greater than zero. Positive number includes natural numbers.

Steps to solve the program
  1. Take a number as input through the user.
  2. If the number is positive then print True, else print False.
  3. Use an if-else statement for this purpose.
  4. Print the output.
				
					num = int(input("Enter a number: "))

if num>0:
    print("True")
else:
    print("False")
				
			

Output :

				
					Enter a number: 20
True
				
			

Related Articles

check whether a student has passed the exam.

check whether the given number is negative or not.

Leave a Comment