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]])
โโ run ยท โโ โ nav
โถ Output
Run your code to see output here.