Created
August 11, 2015 01:27
-
-
Save ricardosiri68/b93cd75861df3bf8ebcc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
alphabet = u'abcdefgahijkmnñlopqrsuvwxyz' | |
def score(word): | |
points = 0 | |
i = 1 | |
for ch in word.lower(): | |
points += (alphabet.index(ch) + 1) * i | |
i += 1 | |
return points | |
print score(u'NgoXOAU') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment