#!/usr/bin/env python
BOARD_SIZE = 8 # square gaming board
NOTHING = '.'
SOMETHING = 'K'
board = [[NOTHING] * BOARD_SIZE] * BOARD_SIZE # indexing: (row, col)
board[0][0] = SOMETHING
for row in board:
for c in row:
print(c, end='')
print()
Now that I was expecting:
$ nano cownway.py &&./cownway.py
K.......
K.......
K.......
K.......
K.......
K.......
K.......
K.......
Please explain in ‘C’ terms what is happening on line board =
.
You need to sign in to view this answers
Leave feedback about this