Test linter and fix pycharm's style warning

This commit is contained in:
kleph 2021-12-10 14:55:03 +01:00
parent 7bf8952928
commit 3d87fab334

View file

@ -5,7 +5,6 @@ def parse_file(file):
with open(file) as f: with open(file) as f:
i = 0 i = 0
for line in f.readlines(): for line in f.readlines():
count_open = {'(': 0, '[': 0, '{': 0, '<': 0}
chunks = [] chunks = []
for c in line.strip(): for c in line.strip():
if c in close_sign.values(): # open signs if c in close_sign.values(): # open signs
@ -28,7 +27,7 @@ parse_file('input.txt')
print(f'char score {count_score}') print(f'char score {count_score}')
score = 0 score = 0
for c in close_sign: for sign in close_sign:
score += count_score[c] * score_table[c] score += count_score[sign] * score_table[sign]
print(f'score: {score}') print(f'score: {score}')