1>>> n = -42
2>>> -n # if you know n is negative
342
4>>> abs(n) # for any n
542
6>>> abs(-5.05)
75.05
1number_to_check = input("enter a number: ")
2
3try:
4 if number_to_check < 0:
5 print("That number is a negative number")
6 else:
7 print("That number is not a negative number")
8
9# Error handling, in case input was a string
10except TypeError:
11 print("That wasn't a number")