写出一个程序,接受一个有字母和数字以及空格组成的字符串,和一个字符,然后输出输入字符串中含有该字符的个数。不区分大小写。
AC 100%:
a = raw_input()
b = raw_input()
print (a.upper().count(b.upper()))
AC 30%:
import sys
a = raw_input()
a = a.upper()
a = a.split()
count = 0
for i in range(0,len(a)-2):
if a[i] == a[-1]:
count +=1
print count