#2020/03/03#可以看到这个程序中只定义了函数,并没有调用函数并打印出来。#我们需要使用import的方法把整个程序导入到python中,然后直接在python中使用程序中的各种功能。defbreak_words(stuff):'''This function will break up words for us. '''
words = stuff.split(' ')return words
defsort_words(words):''' Sorts the words.'''returnsorted(words)defprint_first_word(words):'''Prints the first word after popping it off.'''
word = words.pop(0)print(word)defprint_last_word(words):'''Prints the last word after popping it off.'''
word = words.pop(-1)print(word)defsort_sentence(sentence):'''Takes in a full sentence and returns the sorted words.'''
words = break_words(sentence)return