top of page
learn_data_science.jpg

Data Scientist Program

 

Free Online Data Science Training for Complete Beginners.
 


No prior coding knowledge required!

Python Program to Check if a Number is Positive, Negative or 0

simple program to check whether a number entered by the user is positive, negative or zero.


num = float(input("Enter a number: "))
if num > 0:
   print("Positive number")
elif num == 0:
   print("Zero")
else:
   print("Negative number")

A number is positive if it is greater than zero

first input is 5 :

Enter a number: 5
Positive number

second input is -2 :

Enter a number: -2
Negative number
0 comments

Recent Posts

See All

Comments


bottom of page