85.5k views
4 votes
Write a program to check the given number is positive negative or zero​

1 Answer

2 votes

Here is a a program to check the given number is positive negative or zero​ with Python code :

# Ask the user to enter a number

num = float(input("Enter a number: "))

# Check if the number is positive, negative, or zero

if num > 0:

print("The number is positive.")

elif num < 0:

print("The number is negative.")

else:

print("The number is zero.")

User Rybosome
by
7.9k points