question 64 Lists & Tuples · easy
Impossible GPS points
A delivery driver's app records a track of (latitude, longitude) points. A latitude must be between -90 and 90, and a longitude between -180 and 180, both inclusive. Print the positions (counting from 0) of every impossible point as a list. If every point is valid, print all valid.
Input
track, a list of (latitude, longitude) tuplesValid
-90 <= latitude <= 90 and -180 <= longitude <= 180Printsthe list of positions of invalid points, or
all validExamplesthe starter's track →
[1, 3]; [(0, 0)] → all validExpected output1 line
- 1[1, 3]