I'd have opted for a ```continue``` here (and below) for readability, but it makes no real difference. I'd also bump this to the first condition and change it to
```python
line = line.strip()
if not line or line.startswith('#'):
    continue
elif...
```
so that any blank/whitespace/comment lines are dealt with quickly.