0 / 34
Scenario

City Distance Calculator

๐Ÿ“‹ Context

You have coordinates for 4 cities and need to compute the distance matrix between all pairs. This is a common task in logistics, mapping, and machine learning (e.g., KNN).

1
2

Step 1: City Coordinates

๐ŸŽฏ Task

Create cities โ€” a (4, 2) array of (x, y) coordinates:
[[0, 0], [3, 4], [6, 0], [3, -4]]
These form a diamond shape. Print it.

np.array([[0,0],[3,4],[6,0],[3,-4]])
exercise.py
โŒ˜โŽ run ยท โŒ˜โ† โ†’ nav
โ–ถ Output
Run your code to see output here.