コード例 #1
0
ファイル: Ex25_modul.py プロジェクト: hercz/PythonHardWay
__author__ = 'herczkumihalybalazs'
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)
print(Ex25.print_first_word(words))
print(Ex25.print_last_word(words))
print(words)
print(Ex25.print_first_word(sorted_words))
print(Ex25.print_last_word(sorted_words))
print(sorted_words)
sorted_words = Ex25.sort_sentence(sentence)
print(sorted_words)
print(Ex25.print_first_and_last(sentence))
print(Ex25.print_first_and_last_sorted(sentence))

コード例 #2
0
ファイル: Ex25b.py プロジェクト: Nre3975/LPTHW
import Ex25

sentence = "All good things come to those who wait"
print(sentence)
words = Ex25.break_words(sentence)
print(words)
print("\n")

sorted_words = Ex25.sort_words(words)
print(sorted_words)
print("\n")

Ex25.print_first_word(words)
Ex25.print_last_word(words)
print(words)
print("\n")

Ex25.print_first_word(sorted_words)
Ex25.print_last_word(sorted_words)
print(sorted_words)
print("\n")

sorted_words = Ex25.sort_sentence(sentence)
print(sorted_words)
print("\n")

Ex25.print_first_and_last(sentence)
Ex25.print_first_and_last_sorted(sentence)