def checkio(field):
rotated_field = zip(*field)
for row in field:
if row[0] == row[1] == row[2] and row[0]!= ".":
return row[0]
else:
for col in rotated_field:
if col[0] == col[1] == col[2] and col[0]!=".":
return col[0]
else:
if field[0][0] == field[1][1] == field [2][2] and field[0][0]!=".":
return field[0][0]
else:
if field[0][2] == field[1][1] == field[2][0] and field[0][2]!=".":
return field[0][2]
else:
return "D"
Created at: 2020/02/27 21:28; Updated at: 2020/02/27 23:50
The question is resolved.