Update line-count.py

If these are supposed to be idiomatic in each language, this is more sensible than explicit looping with a counter.