import random x = random.randint(-2, 2) y = random.randint(-2, 2) #x, y = 0, 0 print(f'The coordinates of a point P: ({x}, {y})') print('P is ', end = '') if x > 0 and y > 0: print('in the 1st quadrant.') elif x < 0 and y > 0: print('in the 2nd quadrant.') elif x < 0 and y < 0: print('in the 3rd quadrant.') elif x > 0 and y < 0: print('in the 4th quadrant.') elif x == 0 and y != 0: print('on the y-axis.') elif x != 0 and y == 0: print('on the x-axis.') else: print('on the origin.')