use ```line.startswith('#')``` instead, as you did earlier; the way it currently is, ```line[0]``` can throw an ```IndexError```