大一python编程题

您所在的位置:网站首页 将输入的字符串大小写进行转换并输出python 大一python编程题

大一python编程题

2022-11-06 04:27| 来源: 网络整理| 查看: 265

⼤⼀

python

编程题

_python

编程题

现需要统计若⼲段⽂字(英⽂)中的不同单词数量。

如果不同的单词数量不超过10个,则将所有单词输出(按字母顺序),否则输出前10个单词。

注1:单词之间以空格(1个或多个空格)为间隔。

注2:忽略空⾏或者空格⾏。

注3:单词⼤⼩写敏感,即‘word‘与‘WORD‘是两个不同的单词 。

输⼊说明

若⼲⾏英⽂,最后以为结束。

输出说明

不同单词数量。

然后输出前10个单词(按字母顺序),如果所有单词不超过10个,则将所有的单词输出。

输⼊样例

Failure is probably the fortification in your pole

It is like a peek your wallet as the thief when you

are thinking how to spend several hard-won lepta

when you Are wondering whether new money it has laid

background Because of you, then at the heart of the

most lax alert and most low awareness and left it

godsend failed

输出样例

49

Are

Because

Failure

It

a

alert

and

are

as

at

words=""

whileTrue:



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3