โ back to unit
Easy
# queues easy
Deal the Cards
Deal around the table, one card at a time โ everyone in turn, round and round, until the deck is gone. ๐ก
You get the deck (top first) and the number of players. Print each player's hand on its own line, comma-separated (a player with no cards prints none).
Example:
Input: deck = ["ace", "two", "three", "four", "five"], players = 2
Output:
ace,three,five
two,four
Cards deal round-robin, so card i goes to player i % 2: player 0 gets ace (0), three (2), five (4); player 1 gets two (1), four (3).
๐ก need a hint?
q-deal-cards.py๐ given lines are locked โ write your code in between
loading...