标签:cti func count 判断 code lower ams war amp
判断是否有ox
sample:
def xo(s):
s = str.lower(s)
s = list(s)
counto=0
countx=0
for item in s:
if item == ‘o‘:
counto+=1
elif item ==‘x‘:
countx+=1
return counto==countx
别人的
def xo(s): s = s.lower() return s.count(‘x‘) == s.count(‘o‘)
标签:cti func count 判断 code lower ams war amp
原文地址:http://www.cnblogs.com/sayHello2World/p/7096056.html