仅打印python中的前25个一致性

问题描述 投票:0回答:1

我正在大学上完成一项任务,我不知道如何只打印单词的前25个一致性而不是整个列表。

python-3.x nlp nltk text-processing corpus
1个回答
0
投票

当您在StackOverflow中提问时,还可以添加问题或尝试对问题进行的尝试,这会很好

words = "I am working on a task from my university and I have no idea how..."
print(words[:25])
list = ['a','b','c','d'.....]
print(list[:25])

输出

"working on a task from my"
['a', 'b'.....]
© www.soinside.com 2019 - 2024. All rights reserved.