fork download
  1. def get_column(board, col_num):
  2. """takes 3x3 game and returns 3 elemtn list containg all values from column number top to bottom"""
  3. result = [board[0][col_num], board[1][col_num], board[2][col_num]]
  4. return result
  5.  
  6. print(get_column(
  7. [['O', 'X', 'O'],
  8. ['X', ' ', ' '],
  9. ['X', ' ', ' ']], 2))
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
['O', ' ', ' ']