<filename>chap25-functions/ex25.py
def break_words(stuff):
    """
    This function will break up words for us
    First: Print the whole sentence.
    Second: Broken words will be printed
    """
    result  = stuff.split(' ')
    print("whole sentence    ={}".format(stuff))
    print("broken words      ={}".format(result))
    print("")
    return result


def sort_words(words):
    """Sorts the words."""
    result = sorted(words)
    print("whole sentence    ={}".format(words))
    print("sorted words      ={}".format(result))
    print("")

    # Poop out
    return result


def print_first_word(words):
    """Prints the first word after popping it off."""
    word = words.pop(0)
    print(word)

    # Poop out
    result = None
    return result


def print_last_word(words):
    """Prints the last word after popping it off."""
    word = words.pop(-1)
    print(word)
    # Poop out
    result = None
    return result


def sort_sentance(sentance):
    """Takes in a full sentance and returns the sorted words."""
    words = break_words(sentance)
    print(words)

    # Poop out
    result = None
    return result


def print_first_and_last(sentance):
    """Prints the first and last words of the sentnace."""
    words = break_words(sentance)
    print_first_word(words)
    print_last_word(words)

    # Poop out
    result = None
    return result


def print_first_and_last_sorted(sentnace):
    """Sorts the words then prints the first and last one."""
    words = sort_sentance(sentnace)
    print_first_word(words)
    print_last_word(words)

    # Poop out
    result = None
    return result

def main():
    # Block of code to break the sentence sentence_01
    sentence_01 = "All good things come to those who wait."
    words_01 = break_words(sentence_01)
    # Sort words
    sort_words(words_01)

    #    print(words_01)

    # Block of code to break the sentence sentence_02
    sentence_02 = "If you can't beat e'm, join e'm."
    words_02 = break_words(sentence_02)

    # Block of code to break the sentence sentence_03
    sentence_03 = "I have no special talent. I am only passionately curious."
    words_03 = break_words(sentence_03)

    # Block of code to break the sentence sentence_04
    sentence_04 = "All that we are is the result of what we have thought."
    words_04 = break_words(sentence_04)

    # Block of code to break the sentence sentence_05
    sentence_05 = "The future depends on what we do during the present."
    words_05 = break_words(sentence_05)

    # Block of code to break the sentence sentence_06
    sentence_06 = "I'm a monkey and i'm proud of it."
    words_06 = break_words(sentence_06)

    # Block of code to break the sentence sentence_07
    sentence_07 = "Early to bed and early to rise, makes a man healthy, wealthy, and wise."
    words_07 = break_words(sentence_07)

    # Block of code to break the sentence sentence_08
    sentence_08 = "I am thankful for all those who said NO to me. It's because of them i'm doing it myself."
    words_08 = break_words(sentence_08)

    # Block of code to break the sentence sentence_09
    sentence_09 = "Early to bed and early to rise, makes a man healthy, wealthy, and wise."
    words_09 = break_words(sentence_09)

    # Block of code to break the sentence sentence_10
    sentence_10 = "Pearls don't lie on the seashore. If you want one, you must dive for it."
    words_10 = break_words(sentence_10)


if __name__ == "__main__":
    main()

<filename>chap25-functions/ex25.py
def break_words(stuff):
    """
    This function will break up words for us
    First: Print the whole sentence.
    Second: Broken words will be printed
    """
    result  = stuff.split(' ')
    print("whole sentence    ={}".format(stuff))
    print("broken words      ={}".format(result))
    print("")
    return result


def sort_words(words):
    """Sorts the words."""
    result = sorted(words)
    print("whole sentence    ={}".format(words))
    print("sorted words      ={}".format(result))
    print("")

    # Poop out
    return result


def print_first_word(words):
    """Prints the first word after popping it off."""
    word = words.pop(0)
    print(word)

    # Poop out
    result = None
    return result


def print_last_word(words):
    """Prints the last word after popping it off."""
    word = words.pop(-1)
    print(word)
    # Poop out
    result = None
    return result


def sort_sentance(sentance):
    """Takes in a full sentance and returns the sorted words."""
    words = break_words(sentance)
    print(words)

    # Poop out
    result = None
    return result


def print_first_and_last(sentance):
    """Prints the first and last words of the sentnace."""
    words = break_words(sentance)
    print_first_word(words)
    print_last_word(words)

    # Poop out
    result = None
    return result


def print_first_and_last_sorted(sentnace):
    """Sorts the words then prints the first and last one."""
    words = sort_sentance(sentnace)
    print_first_word(words)
    print_last_word(words)

    # Poop out
    result = None
    return result

def main():
    # Block of code to break the sentence sentence_01
    sentence_01 = "All good things come to those who wait."
    words_01 = break_words(sentence_01)
    # Sort words
    sort_words(words_01)

    #    print(words_01)

    # Block of code to break the sentence sentence_02
    sentence_02 = "If you can't beat e'm, join e'm."
    words_02 = break_words(sentence_02)

    # Block of code to break the sentence sentence_03
    sentence_03 = "I have no special talent. I am only passionately curious."
    words_03 = break_words(sentence_03)

    # Block of code to break the sentence sentence_04
    sentence_04 = "All that we are is the result of what we have thought."
    words_04 = break_words(sentence_04)

    # Block of code to break the sentence sentence_05
    sentence_05 = "The future depends on what we do during the present."
    words_05 = break_words(sentence_05)

    # Block of code to break the sentence sentence_06
    sentence_06 = "I'm a monkey and i'm proud of it."
    words_06 = break_words(sentence_06)

    # Block of code to break the sentence sentence_07
    sentence_07 = "Early to bed and early to rise, makes a man healthy, wealthy, and wise."
    words_07 = break_words(sentence_07)

    # Block of code to break the sentence sentence_08
    sentence_08 = "I am thankful for all those who said NO to me. It's because of them i'm doing it myself."
    words_08 = break_words(sentence_08)

    # Block of code to break the sentence sentence_09
    sentence_09 = "Early to bed and early to rise, makes a man healthy, wealthy, and wise."
    words_09 = break_words(sentence_09)

    # Block of code to break the sentence sentence_10
    sentence_10 = "Pearls don't lie on the seashore. If you want one, you must dive for it."
    words_10 = break_words(sentence_10)


if __name__ == "__main__":
    main()

This function will break up words for us     First: Print the whole sentence.     Second: Broken words will be printed Sorts the words. # Poop out Prints the first word after popping it off. # Poop out Prints the last word after popping it off. # Poop out Takes in a full sentance and returns the sorted words. # Poop out Prints the first and last words of the sentnace. # Poop out Sorts the words then prints the first and last one. # Poop out # Block of code to break the sentence sentence_01 # Sort words #    print(words_01) # Block of code to break the sentence sentence_02 # Block of code to break the sentence sentence_03 # Block of code to break the sentence sentence_04 # Block of code to break the sentence sentence_05 # Block of code to break the sentence sentence_06 # Block of code to break the sentence sentence_07 # Block of code to break the sentence sentence_08 # Block of code to break the sentence sentence_09 # Block of code to break the sentence sentence_10