Веляна обнови решението на 19.03.2014 00:20 (преди над 10 години)
+from functools import cmp_to_key
+
+def is_pangram(sentence):
+ letter_list = 'абвгдежзийклмнопрстуфхцчшщъьюя'
+ for letter in letter_list:
+ if not letter in sentence.lower():
+ return False
+ return True
+
+def char_histogram(text):
+ symbol_dict = {}
+ for symbol in text:
+ symbol_dict[str(symbol)] = text.count(symbol)
+
+ return symbol_dict
+
+def sort_by(func, arguments):
+ return sorted(arguments, key = cmp_to_key(func))
+
+def group_by_type(dictionary):
+ result = {}
+ for key in dictionary:
+ if not type(key) in result:
+ result[type(key)] = {key:dictionary[key]}
+ else:
+ result[type(key)][key] = dictionary[key]
+ return result
+
+def is_anagram(word1, word2):
+ return (sorted(list(word1)) == sorted(list(word2)))
+
+def word_anagram(word, words_list):
+ result = []
+ for word2 in words_list:
+ if is_anagram(word, word2):
+ result.append(word2)
+ return result
+
+def anagrams(words):
+ result = []
+ for word in words:
+ if not word_anagram(word, words) in result:
+ result.append(word_anagram(word, words))
+ return result