(allCards)
| 105 | |
| 106 | |
| 107 | def displayCards(allCards): |
| 108 | rows = ['', '', '', '', ''] # The text to display on each row. |
| 109 | |
| 110 | for card in allCards: |
| 111 | rank = card[0] |
| 112 | suit = card[1] |
| 113 | rows[0] += ' ___ ' # Print the top line of the card. |
| 114 | rows[1] += '|{} | '.format(rank.ljust(2)) |
| 115 | rows[2] += '| {} | '.format(suit) |
| 116 | rows[3] += '|_{}| '.format(rank.rjust(2, '_')) |
| 117 | |
| 118 | # Print each row on the screen: |
| 119 | for row in rows: |
| 120 | print(row) |
| 121 | |
| 122 | |
| 123 | # Call the main() function to play the game: |