Last active
October 19, 2021 05:25
-
-
Save cbscribe/ddf81bf4d70bc731a47737f774809a45 to your computer and use it in GitHub Desktop.
Readability starting code
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 count_letters(text): | |
# TODO: Count the number of letters | |
num_letters = 0 | |
print(num_letters, "letter(s)") | |
return num_letters | |
def count_words(text): | |
# TODO: Count the number of words | |
num_words = 0 | |
print(num_words, "word(s)") | |
return num_words | |
def count_sentences(text): | |
# TODO: Count the number of sentences | |
num_sentences = 0 | |
print(num_sentences, "sentence(s)") | |
return num_sentences | |
text = input("Text: ") | |
letters = count_letters(text) | |
words = count_words(text) | |
sentences = count_sentences(text) | |
# TODO: Compute the reading level of the text | |
# using the number of letters, words, and sentences. | |
index = 0 | |
# TODO: Print the reading level of the text. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment