Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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, ]
- 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', 'æ', 'ø', 'å']
- PRIME_CHAR = dict(zip(ALPHABET, PRIMES))
- print PRIME_CHAR
- def unique_word_sum(word):
- return sum(PRIME_CHAR[character] for character in word)
- print unique_word_sum('abcø')
Add Comment
Please, Sign In to add comment