题解 | #计算某字符出现次数#
计算某字符出现次数
https://www.nowcoder.com/practice/a35ce98431874e3a820dbe4b2d0508b1
str1=input() str2=input() if str2.isdigit():#判断str2是否为数字 print(str1.count(str2)) else: print(str1.count(str2.upper())+str1.count(str2.lower()))
计算某字符出现次数
https://www.nowcoder.com/practice/a35ce98431874e3a820dbe4b2d0508b1
str1=input() str2=input() if str2.isdigit():#判断str2是否为数字 print(str1.count(str2)) else: print(str1.count(str2.upper())+str1.count(str2.lower()))
相关推荐