Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 061e659cfb
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 18 lines (15 sloc) 0.332 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
def name_score(name):
    score = 0
    for char in name:
        score += ord(char) - ord('A') + 1
    return score

f = open("names.txt", "r")
names = f.read()
names = names.replace('"', '')
names = names.split(',')
names.sort()
s = 0
for i in range(len(names)):
    score = name_score(names[i]) * (i + 1)
    s += score

print s
Something went wrong with that request. Please try again.