Skip to content

Instantly share code, notes, and snippets.

@KDercksen
Created December 27, 2017 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KDercksen/3be191b78e639349e95ce7c32ee62a7d to your computer and use it in GitHub Desktop.
Save KDercksen/3be191b78e639349e95ce7c32ee62a7d to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
word = sys.argv[1]
scores = [ord(letter) - 96 for letter in word.lower() if letter.isalpha()]
print(f'{word} = {" + ".join(map(str, scores))} = {sum(scores)}%')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment