Skip to content
Snippets Groups Projects
Commit 836148ca authored by aslesha's avatar aslesha
Browse files

lab2 q1

parent 9b715a8c
Branches
No related tags found
No related merge requests found
Pipeline #159 canceled
counter_dict = {}
with open('names.txt') as f:
line = f.readline()
while line:
line = line.strip()
if line in counter_dict:
counter_dict[line] += 1
else:
counter_dict[line] = 1
line = f.readline()
print(counter_dict)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment