小甲鱼 发表于 2021-10-21 19:23:45

已有 23 人购买  本主题需向作者支付 5 鱼币 才能浏览 购买主题

qiuyouzhi 发表于 2021-10-21 19:32:16

感觉有锅
w =

chenduanyun 发表于 2021-10-21 21:15:25

w = ', text) if len(item)>5]

TeslaTong 发表于 2021-10-22 01:57:30

w =

小李和小陈 发表于 2021-10-22 08:57:11

{:10_249:}{:10_247:}{:10_247:}

狠人呀 发表于 2021-10-22 09:02:23

{:10_250:}{:10_250:}{:10_250:}{:10_250:}{:10_250:}{:10_250:}{:10_250:}

painx 发表于 2021-10-22 11:11:43

w=

SkyMagic 发表于 2021-11-9 18:32:51

小师妹我爱你

君月 发表于 2021-11-16 23:34:51

查看解析

魔界风信子 发表于 2021-11-18 09:48:11

本帖最后由 魔界风信子 于 2021-11-18 09:56 编辑

学习
w =

LZRoc 发表于 2021-11-26 16:57:58

text = """
Once upon a time there were three little sisters,
the Dormouse began in a great hurry;
and their names were Elsie, Lacie, and Tillie;
and they lived at the bottom of a well.
‘What did they live on?’ said Alice,
who always took a great interest in questions
of eating and drinking."""

w = list(word for word in text.replace(","," ").replace(";"," ").replace("."," ").replace("?"," ").replace("‘"," ").replace("’"," ").replace("\n"," ").split(" ")if len(word)>5)

print(w)

askhaflkawkl 发表于 2021-11-27 18:11:19

.

python爱好者. 发表于 2021-11-28 18:52:07

text = """
Once upon a time there were three little sisters,
the Dormouse began in a great hurry;
and their names were Elsie, Lacie, and Tillie;
and they lived at the bottom of a well.
‘What did they live on?’ said Alice,
who always took a great interest in questions
of eating and drinking."""

w =

print(w)

在东边 发表于 2022-1-9 16:02:10

w =

唱离歌的老鼠 发表于 2022-1-10 08:52:52

先把他化作一个列表:text.strip().replace('\n','').split(' ')
然后遍历一下,相同的单词每次加1,但是一行代码怎么搞定,还有点费劲。

zmxm123 发表于 2022-1-11 10:01:28

学习学习

python初学者_1 发表于 2022-1-12 11:07:08

1

xiannv2b 发表于 2022-1-25 15:33:29

1

ckblt 发表于 2022-2-7 16:10:40

w =

y1571908792 发表于 2022-2-9 18:47:32

w =
页: [1] 2 3 4 5 6
查看完整版本: 请用一行代码找出多于5个字符的单词