Example #1
0
def main():
    sentence = "All good things come to those who wait."
    words = ex25.break_words(sentence)
    print(words)
    sorted_words = ex25.sort_words(words)
    print(sorted_words)
    ex25.print_first_word(sorted_words)
    ex25.print_last_word(sorted_words)
    print(sorted_words)
    sorted_words = ex25.sort_sentence(sentence)
    print(sorted_words)
    ex25.print_first_and_last(sentence)
    ex25.print_first_and_last_sorted(sentence)
import ex25
sentence = "All good things come to those who wait."
words = ex25.break_words(sentence)
print words

sorted_words = ex25.sort_words(words)
print sorted_words

ex25.print_first_word(words)

ex25.print_last_word(words)

sorted_words = ex25.sort_sentence(sentence)

print sorted_words

ex25.print_first_and_last(sentence)

ex25.print_first_and_last_sorted(sentence)

help(ex25)
Example #3
0
sentence = "All good things come to those who wait."
#words = break_words(sentence)
words = ex25.break_words(sentence)
words  #
sorted_words = ex25.sort_words(words)
sorted_words  #
ex25.print_first_word(words)  #打印了个All
ex25.print_last_word(words)  #打印了个wait.
words  #
ex25.print_first_word(sorted_words)  #打印了个All。
ex25.print_last_word(sorted_words)  # 打印了个who
sorted_words  #
sorted_words = ex25.sort_sentence(sentence)
sorted_words  #
ex25.print_first_and_last(sentence)  #C: 打印第一个All和最后一个字wait。
ex25.print_first_and_last_sorted(sentence)  # D 打印第一个All和最后一个sorted的句子who。
print("-------- THE END ----------")
print("---------下面是采用了from ex25 import *")
from ex25 import *
sentence = "All good things come to those who wait."
#words = break_words(sentence)
words = break_words(sentence)
words  #
sorted_words = sort_words(words)
sorted_words  #
print_first_word(words)  #打印了个All
print_last_word(words)  #打印了个wait.
words  #
print_first_word(sorted_words)  #打印了个All。
print_last_word(sorted_words)  # 打印了个who
sorted_words  #
Example #4
0
from ex25a import adder
import ex25

print(adder(3, 4))
line = "this is new line not the previous one"
words = ex25.break_words(line)
print(words)
print(ex25.sort_words(words))
ex25.print_first_word(words)
ex25.print_last_word(words)
print(ex25.sort_sentence(line))
ex25.print_first_and_last(line)
ex25.print_first_and_last_sorted(line)
Example #5
0
import ex25

sentence = "All good things come to those who wait."

words = ex25.break_words(sentence)
print words

sorted_words = ex25.sort_words(words)
print sorted_words
"""
ex25.print_first_word(words)
ex25.print_last_word(words)
print words
"""

ex25.print_first_word(sorted_words)
ex25.print_last_word(sorted_words)
print sorted_words

"""sorted_words = ex25.sort_sentence(sentence)
print sorted_words
"""
"""ex25.print_first_and_last(sentence)
ex25.print_first_and_last_sorted(sentence)
print sentence
"""
import ex25

#print break_words("djsafauroew fj dklasj jfdl ajsfl ldj ls")
#print sort_words("dflajfkld f falj dlsa lj lfsald jfla")
#print_first_word([3, 4, 5, 6, 7])
#print_last_word([3, 4, 5, 6, 7])
#print sort_sentence("dflajfkld f falj dlsa lj lfsald jfla")
ex25.print_first_and_last("dflajfkld f falj dlsa lj lfsald jfla")
ex25.print_first_and_last_sorted("dflajfkld f falj dlsa lj lfsald jfla")
help(ex25.break_words)