The logical AND operator combines conditions: the result is true only when both operands are truthy. In Python, it can also return an operand value rather than a Boolean. section 21.2.1
Validate a board
Require both a nine-character board and valid characters: `len(board) == 9 and all([c in '.XO' for c in board])`. The expression is true for `...XXXOOO` and false when the board contains `A`.
if any([args.player, args.cell]) and not all([args.player, args.cell]):
parser.error('Must provide both --player and --cell')
Inspect a compact command-line validation condition that requires `--player` and `--cell` together or rejects the input. section 21.2.1






