Skip to content

Instantly share code, notes, and snippets.

@cbscribe
Last active October 19, 2021 05:25
Show Gist options
  • Save cbscribe/ddf81bf4d70bc731a47737f774809a45 to your computer and use it in GitHub Desktop.
Save cbscribe/ddf81bf4d70bc731a47737f774809a45 to your computer and use it in GitHub Desktop.
Readability starting code
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