diff --git a/readability_is_king.py b/readability_is_king.py new file mode 100644 index 0000000..6591d7f --- /dev/null +++ b/readability_is_king.py @@ -0,0 +1,24 @@ +# Readability is King Codewars Kata https://www.codewars.com/kata/52b2cf1386b31630870005d4 + +def avarage_words_sentence(text): + sentences = text.split(".") + sentences.pop(-1) + + average_words_sentence = [] + + for sentence in sentences: + sentence = sentence.split() + average_words_sentence.append(len(sentence)) + + return sum(average_words_sentence) / len(average_words_sentence) + +def avarage_syllables(text): + vowels = {"a", "e", "i", "o", "u"} + +def flesch_kincaid(text): + average_words_sentence = avarage_words_sentence(text) + avaraage_syllables = avaraage_syllables(text) + + return average_words_sentence + +print(flesch_kincaid("To be or not to be. That is the question.")) \ No newline at end of file