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