Given some points (cartesian coordinates), return true if all of them lie on a line.  Treat both an empty set and a single point as a line.
```python
on_line(((1,2), (7,4), (22,9)) == True
on_line(((1,2), (-3,-14), (22,9))) == False
```
def on_line(points):
    try:
        x1, y1 = points[0]
        x2, y2 = points[-1]
    except:
        return True
    for i in points[1:-1]:
        x3, y3 = i
        if (x1 - x3)*(y2 - y3) != (x2 - x3)*(y1 - y3):
            return False
    return True
def on_line(points):
    try:
        x1, y1 = points[0]
        x2, y2 = points[-1]
    except:
        return True
    for i in points[1:-1]:
        x3, y3 = i
        if (x1 - x3)*(y2 - y3) != (x2 - x3)*(y1 - y3):
            return False
    return True