aboutsummaryrefslogtreecommitdiff
path: root/python/022-names_scores.py
blob: 7bba853a639b37e8df300065e5b0d7e25f1b5dba (plain)
1
2
3
4
5
6
7
8
9
names = []
with open('./helper/data/names.txt', 'r') as file:
    names = sorted([n[1:-1] for n in file.read().split(',')])

total = 0
for i, name in enumerate(names):
    total += sum([ord(s) - 64 for s in name]) * (i + 1)

print(total)