MakingLibrarySoftware3

def count_word(paragraph, word):
    '''counts the number of times a word appears in a paragraph'''
    pass

def capitalize_word(paragraph, word):
    '''capitalizes all instances of a word in a paragraph'''
    pass

def exclamize(paragraph):
    '''makes every sentence in a paragraph an exclamation!'''
    pass

def sort_words(paragraph):
    '''sort the words in a paragraph'''
    pass

now, write a script that allows a user to type in a paragraph and runs each function on that paragraph, in order.

Here's an example of the exercise from this session worked out…

def count_word(paragraph, word):
    '''counts the number of times a word appears in a paragraph'''
    words = paragraph.split()
    return words.count(word)

def capitalize_word(paragraph, word):
    '''capitalizes all instances of a word in a paragraph'''
    paragraph = paragraph.replace(word,word.capitalize())
    return paragraph

def exclamize(paragraph):
    '''makes every sentence in a paragraph an exclamation!'''
    paragraph = paragraph.replace('.','!')
    paragraph = paragraph.replace('?','!')
    return paragraph

def sort_words(paragraph):
    '''sort the words in a paragraph'''
    words = paragraph.split()
    words.sort()
    return words