2024-04-20 07:12:25 发布
网友
import nltk from nltk.tokenize import sent_tokenize, word_tokenize sentence = """At eight o'clock on Thursday morning Arthur didn't feel very good.""" a=word_tokenize(sentence) if a[3] == 'on' print a
语法错误,您在if条件后忘记了冒号:
if
if a[3] == 'on': print a
我得到了这个输出:
['At', 'eight', "o'clock", 'on', 'Thursday', 'morning', 'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']
语法错误,您在
if
条件后忘记了冒号:我得到了这个输出:
相关问题 更多 >
编程相关推荐