小编Sbo*_*ian的帖子

如何使这个字符计数器对案例不敏感?

我写了这个小代码来计算文本中单词的出现次数:

string=input("Paste text here: ")
word=input("Type word to count: ")
string.count(word)
x=string.count(word)
print (x)
Run Code Online (Sandbox Code Playgroud)

问题是它区分大小写.如何使其不区分大小写?

python

6
推荐指数
2
解决办法
8749
查看次数

标签 统计

python ×1