This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_triangle(w): | |
return sum([ord(c)-64 for c in w]) in TN | |
L = list(eval(open('words.txt').readlines()[0])) #loading data | |
# creating triangle number list as i don't want to check triagulity every time | |
i,TN = 0,[] | |
for j in range(1,30): | |
i += j; TN.append(i) | |
NewerOlder