Answers for "how to check number is negative in python"

2

how to check if number is negative in python

num = -10

if num < 0:
  print(f"number you entered:{num} is negative")
Posted by: Guest on June-25-2021
0

python check string for negative number

I = input("Enter a number: ")

if I.lstrip('-').isnumeric():
  # ACTION HERE
  # I IS A NUMBER
Posted by: Guest on October-09-2021

Code answers related to "how to check number is negative in python"

Python Answers by Framework

Browse Popular Code Answers by Language