admin管理员组文章数量:1660603
给出一个字符串 s
,内容参见"编程模板",请统计并打印字符串 s
中出现单词的个数。
示例1:
输入:无
输出:10
注意:示例1 是一个输入输出示范样例,不是正确结果。
s = '''
"Collusion is very real with Russia," Trump quoted conservative commentator Dan Bongino as saying on Trump's favorite Fox News morning show, "but only with Hillary and the Democrats, and we should demand a full investigation."
'''
代码部分:
s = '''
"Collusion is very real with Russia," Trump quoted conservative commentator Dan Bongino as saying on Trump's favorite Fox News morning show, "but only with Hillary and the Democrats, and we should demand a full investigation."
'''
x=s.replace('"','').replace(',','').replace('\n','').replace('.','').split(' ')
print(len(x))
版权声明:本文标题:英文单词个数统计 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1729813391a1213604.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论