Python program to Detect the Coordinate of a Point

x = float(input("Insert coordinate of point x: "))
y = float(input("Insert coordinate of point y: "))
if x > 0 and y > 0:
 print("The first quadrant")
elif x < 0 and y >0:
 print("The second quadrant")
elif x < 0 and y < 0:
 print("The third quadrant")
elif x == 0 and y == 0:
 print("Point of origin")
elif x == 0:
 print("x point")
elif y == 0:
 print("y point")

 

 

Output:

Insert coordinate of point x: 1
Insert coordinate of point y: 1
The first quadrant

 

Insert coordinate of point x: -1
Insert coordinate of point y: 1
The second quadrant

 

Insert coordinate of point x: 0
Insert coordinate of point y: 0
Point of origin

 

Subscribe For Daily Updates

100+ Python Pattern Examplespython pattern examples - star patterns, number patterns