Skip to content

Commit e07791b

Browse files
committed
touchups
1 parent 669595a commit e07791b

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

14_rhymer/solution1_regex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def get_args():
1414
description='Make rhyming "words"',
1515
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1616

17-
parser.add_argument('word', metavar='str', help='A word to rhyme')
17+
parser.add_argument('word', metavar='word', help='A word to rhyme')
1818

1919
return parser.parse_args()
2020

21_tictactoe/solution1.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ def main():
5656

5757
args = get_args()
5858
board = list(args.board)
59-
player = args.player
60-
cell = args.cell
6159

62-
if player and cell:
63-
board[cell - 1] = player
60+
if args.player and args.cell:
61+
board[args.cell - 1] = args.player
6462

6563
print(format_board(board))
6664
winner = find_winner(board)

21_tictactoe/solution2.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,9 @@ def main():
5656

5757
args = get_args()
5858
board = list(args.board)
59-
player = args.player
60-
cell = args.cell
6159

62-
if player and cell:
63-
board[cell - 1] = player
60+
if args.player and args.cell:
61+
board[args.cell - 1] = args.player
6462

6563
print(format_board(board))
6664
winner = find_winner(board)

21_tictactoe/unit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ def test_losing():
6363

6464
losing_board = list('XXOO.....')
6565

66-
for i in range(10):
66+
for _ in range(10):
6767
random.shuffle(losing_board)
68-
assert find_winner(''.join(losing_board)) == None
68+
assert find_winner(''.join(losing_board)) is None

0 commit comments

Comments
 (0)