def problem_42(): # get the values of all words in the list values = [get_value(name) for name in word_list()] # get all triangle numbers whose values are less than or equal to the max word score triangles_numbers = list(triangle_numbers(limit=max(values))) # get a count of word value that are triangle numbers print(len([x for x in values if x in triangles_numbers]))
def problem_12(): for num in triangle_numbers(): if count_factors(num) > 500: print(num) break