【发布时间】:2015-08-07 02:34:54
【问题描述】:
我有一个文本文件,其中包含:
I like potatoes
Potatoes are good
Potatoes contain starch
我想测试每个句子是否按字典顺序排列。
如果句子是,我希望它输出“This is in lexicographic order”
我不太确定该怎么做。
【问题讨论】:
-
你有什么问题?
-
不知道从哪里开始...例如如何将文本文件分成不同的行,然后分成单词以检查它们的顺序。
标签: python input lexicographic