Skip to content

Commit d423ce1

Browse files
committed
Add new file
1 parent f7aa0e1 commit d423ce1

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

xo.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
def xo(s):
2+
count_x = 0
3+
for i in s:
4+
if i == 'x':
5+
count_x += 1
6+
if i == 'X':
7+
count_x += 1
8+
9+
# print count_x
10+
11+
count_o = 0
12+
for i in s:
13+
if i == 'o':
14+
count_o += 1
15+
if i == 'O':
16+
count_o += 1
17+
18+
# print count_o
19+
20+
if count_x == count_o:
21+
print True
22+
23+
else:
24+
print False
25+
26+
# if 'x' and 'X' and 'o' and 'O' not in s:
27+
# return True
28+
29+
30+
xo('vxQxpxxSxfmExkxAxGborNLxooxxxoxxCodoooxxoxxootxhUoJox')
31+
xo('xo0')
32+
xo('x0xxxooooxxxxxx')
33+
xo('frtxioopx')
34+
xo('FFFF')

0 commit comments

Comments
 (0)