Skip to content

Instantly share code, notes, and snippets.

@ricardosiri68
Created August 11, 2015 01:27
Show Gist options
  • Save ricardosiri68/b93cd75861df3bf8ebcc to your computer and use it in GitHub Desktop.
Save ricardosiri68/b93cd75861df3bf8ebcc to your computer and use it in GitHub Desktop.
# -*- 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