Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with open('wordlist.txt') as wordList: #open wordlist file
- for word in wordList: #iterate through words in list
- wordTotal = 0
- for c in word.upper(): #iterate through letters in word
- charNum = ord(c)-64 #convert a-z to 1-26
- if charNum >= 1 and charNum <= 26: #ignore non-letters
- wordTotal += charNum #add letter to word total
- if wordTotal == 100:
- print (word)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement