>>> get_opponent(generate_table('marvin')[0], 'M') 'T'
(table: tuple[str, str], char: str)
| 72 | |
| 73 | |
| 74 | def get_opponent(table: tuple[str, str], char: str) -> str: |
| 75 | """ |
| 76 | >>> get_opponent(generate_table('marvin')[0], 'M') |
| 77 | 'T' |
| 78 | """ |
| 79 | row, col = get_position(table, char.upper()) |
| 80 | if row == 1: |
| 81 | return table[0][col] |
| 82 | else: |
| 83 | return table[1][col] if row == 0 else char |
| 84 | |
| 85 | |
| 86 | if __name__ == "__main__": |
no test coverage detected