Кирил обнови решението на 16.03.2014 19:18 (преди над 10 години)
+
+def is_pangram(sentence):
+ letters = [i for i in sentence.lower()]
+ sentence_alphabeth = set()
+ alphabet = 'абвгдежзийклмнопрстуфхчцшщьъюя'
+ for letter in letters:
+ if letter in alphabet:
+ sentence_alphabeth.add(letter)
+ return 30 == len(sentence_alphabeth)
+
+
+
+def char_histogram(text):
+ letters = [i for i in text]
+ resulting_dict = dict()
+ for i in letters:
+ if i not in resulting_dict:
+ resulting_dict[i] = 1
+ else:
+ resulting_dict[i] = resulting_dict[i] + 1
+ return resulting_dict
+
+
+def sort_by_izmislen(func, arguments):
+ for index in range(0, len(arguments) - 1):
+ for i in range(1, len(arguments)):
+ if index >= i:
+ pass
+ elif int(func(arguments[index], arguments[i])) > 0:
+ arguments[index], arguments[i] = arguments[i], arguments[index]
+ else:
+ pass
+ return arguments
+
+
+def anagrams(words):
+ result = [] # rezultata
+ for word in words:
+ words.remove(word)
+ temp_words = [i for i in words]
+ temp_result = [word]
+ for second_word in temp_words:
+ if is_anagrams(word, second_word):
+ temp_result.append(second_word)
+ for w in temp_result:
+ if w != word:
+ words.remove(w)
+ result.append(temp_result)
+ result.append(words)
+ return result
+
+def is_anagrams(first, second):
+ set_of_letters = [_ for _ in first]
+ for letter in second:
+ if letter not in set_of_letters:
+ return False
+ else:
+ set_of_letters.remove(letter)
+ return True
+
+