Prompt to enter `n` player names. Args: n (int): number of players Returns: List[str]: list of player names Example: >>> import builtins >>> inputs = iter(["Alice", "Bob"]) >>> builtins.input = lambda prompt="": next(inputs) >>> get
(n: int)
| 26 | |
| 27 | |
| 28 | def get_players(n: int) -> List[str]: |
| 29 | """ |
| 30 | Prompt to enter `n` player names. |
| 31 | |
| 32 | Args: |
| 33 | n (int): number of players |
| 34 | |
| 35 | Returns: |
| 36 | List[str]: list of player names |
| 37 | |
| 38 | Example: |
| 39 | >>> import builtins |
| 40 | >>> inputs = iter(["Alice", "Bob"]) |
| 41 | >>> builtins.input = lambda prompt="": next(inputs) |
| 42 | >>> get_players(2) |
| 43 | ['Alice', 'Bob'] |
| 44 | """ |
| 45 | return [input("Enter name of player: ") for _ in range(n)] |
| 46 | |
| 47 | |
| 48 | def play_turn(player: str) -> int: |