A simple if-else statement comparing if inputs are greater or less than 0 outputting their respective quadrant number(assuming the inputs can not equal 0)
a = int(input())
b = int(input())
if a > 0 and b > 0:
print(1)
elif a < 0 and b > 0:
print(2)
elif a < 0 and b < 0:
print(3)
else:
print(4)
Commentaires