Exes and Ohs
作者:
是不及呀 | 来源:发表于
2018-11-28 11:03 被阅读0次
题意
题解1
def xo(s):
a = 0
b = 0
for i in s:
if i == 'x' or i == 'X':
a += 1
for j in s:
if j == 'o' or j == 'O':
b += 1
if a ==b:
return True
else:
return False
题解2
def xo(s):
a = 0
b = 0
for c in s:
if c == 'x' or c == 'X':
a += 1
if c == 'o' or c == 'O':
b += 1
if a == b:
return True
else:
return False
题解3
def xo(s):
a = 0
b = 0
for c in s:
if c == 'x' or c == 'X':
a += 1
if c == 'o' or c == 'O':
b += 1
return a == b
本文标题:Exes and Ohs
本文链接:https://www.haomeiwen.com/subject/eajoqqtx.html
网友评论