I think this reads slightly cleaner.

This commit is contained in:
Sage Vaillancourt 2023-08-19 21:38:30 -04:00
parent 80e90b5ddc
commit 6f6abc6f65

View file

@ -34,10 +34,9 @@ def wordCount(text):
count = 0 count = 0
in_comment = False in_comment = False
for word in words: for word in words:
if in_comment: if in_comment and word == '-->':
if word == '-->': in_comment = False
in_comment = False if not in_comment:
else:
if word == '<!--': if word == '<!--':
in_comment = True in_comment = True
else: else: