Euler txt files now follow naming convention
This commit is contained in:
@@ -3,7 +3,7 @@ def get_score_for_name(name):
|
||||
|
||||
|
||||
def euler_022():
|
||||
with open('../txt/EulerProblem022.txt', 'r') as f:
|
||||
with open('../txt/e022.txt', 'r') as f:
|
||||
names = f.read().split(',')
|
||||
names.sort()
|
||||
s = sum([(i + 1) * get_score_for_name(name)
|
||||
@@ -15,3 +15,4 @@ if __name__ == "__main__":
|
||||
assert(get_score_for_name('COLIN') == 53)
|
||||
assert(euler_022() == 871198282)
|
||||
print("e022.py: {}".format(euler_022()))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user