concept all card in category python

This is an excerpt from Manning's book Get Programming: Learn to code with Python.
The first step is to set up the game by creating two Player objects and one CardDeck object. You ask for the names of two players, create a new Player object for each, and call the method to set the name. This is shown in the following listing.
Listing 34.5. Initializing game variables and objects
name1 = input("What's your name? Player 1: ") #1 player1 = Player(name1) #2 name2 = input("What's your name? Player 2: ") player2 = Player(name2) deck = CardDeck() #3After initializing the object you’ll use in the game, you can now simulate the game.
A game consists of many rounds and continues until the deck is empty. It’s possible to calculate the number of rounds players will play; if each player takes a card every round and there are 32 cards in the deck, there’ll be 16 rounds. You could use a for loop to count the rounds, but a while loop is also an acceptable way of implementing the rounds.