Untitled
def checkerboard(rows=8, cols=8): WHITE = 'X' BLACK = 'O' for i in range(rows): row = [] for j in range(cols): if (i+j)%2 == 0: row.append(WHITE) else: row.append(BLACK) print(''.join(row))
def checkerboard(rows=8, cols=8): WHITE = 'X' BLACK = 'O' for i in range(rows): row = [] for j in range(cols): if (i+j)%2 == 0: row.append(WHITE) else: row.append(BLACK) print(''.join(row))