Search⌘ K
AI Features

Challenge: Read the Line Segments

Explore how to filter points and line segments according to their quadrant positions using Python tuples and built-in data structures. Understand quadrant definitions with axis tie-breaking rules, and develop skills to return segment IDs that fit specific quadrant criteria. This lesson enhances your ability to work efficiently with geometric data in Python.

Problem 1

You are given a list of points represented as tuples (x, y).
Your task is to filter out and return only those points that lie in the 2nd quadrant. Diagram to understand quadrants better is attached below.

Example input:

points = [(2, 3), (-1, 5), (-3, -2), (-4, 0)]

Expected output:

 ...