Guest User

Untitled

a guest
Nov 21st, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. PRIMES = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, ]
  2. ALPHABET = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'æ', 'ø', 'å']
  3.  
  4. PRIME_CHAR = dict(zip(ALPHABET, PRIMES))
  5. print PRIME_CHAR
  6. def unique_word_sum(word):
  7.     return sum(PRIME_CHAR[character] for character in word)
  8.  
  9. print unique_word_sum('abcø')
Add Comment
Please, Sign In to add comment