Draw a number of cards from the top of the global `unoDeck`. Raises ValueError if the deck runs out of cards.
(numCards: int)
| 56 | |
| 57 | |
| 58 | def drawCards(numCards: int) -> List[str]: |
| 59 | """ |
| 60 | Draw a number of cards from the top of the global `unoDeck`. |
| 61 | |
| 62 | Raises ValueError if the deck runs out of cards. |
| 63 | """ |
| 64 | cardsDrawn: List[str] = [] |
| 65 | for x in range(numCards): |
| 66 | try: |
| 67 | cardsDrawn.append(unoDeck.pop(0)) |
| 68 | except IndexError: |
| 69 | raise ValueError("The deck is empty; cannot draw more cards") |
| 70 | return cardsDrawn |
| 71 | |
| 72 | |
| 73 | """ |