Please answer it in Python Write a function distribute_cartes that has two mandatory arguments card and players and an optional argument nb_card whose default value is 10. The pick argument corresponds to the complete list of cards in the game, already shuffled. The players list corresponds to the list of player names. This function allows the action of distributing nb_card cards from the pickaxe to each of the players. She builds a djeux dictionary whose keys are the names of the players and associating with each name the list of cards corresponding to her game. We will make sure to sort the game of each player in ascending order using the spell function. The distribute_card function returns the dictionary and modifies its pickaxe argument by edge effet (cards dealt to players must be removed from the pickaxe). It is assumed here that the pickaxe contains sufficiently cards for all players. For example card = [74, 72, 59, 82, 44, 77, 17, 11, 62, 97, 83, 69, 100, 22, 4, 51, 55, 50, 103, 52, 13, 25, 38, 37, 29, 104, 47, 23, 39, 80, 49, 98, 8, 78, 26, 46, 86, 18, 93, 31, 27, 34, 85, 84, 76, 87, 65, 35, 81, 79, 101, 66, 20, 91, 73, 16, 102, 42, 40, 70, 90, 7, 6, 64, 14, 67, 43, 12, 58, 1, 63, 2, 75, 32, 48, 96, 3, 15, 99, 68, 53, 61, 56, 92, 36, 28, 19, 5, 24, 45, 57, 94, 21, 54, 88, 33, 10, 71, 30, 95, 9, 41, 60, 89] players = ['rara', 'riri', 'rere']   distribute_cartes(card,players,nb_card=10) #return => {'rara': 74, 72, 59, 82, 44, 77, 17, 11, 62, 97, 'riri': 83, 69, 100, 22, 4, 51, 55, 50, 103, 52 , rere: 13, 25, 38, 37, 29, 104, 47, 23, 39, 80}

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Please answer it in Python

Write a function distribute_cartes that has two mandatory arguments card and players and an optional argument nb_card whose default value is 10. The pick argument corresponds to the complete list of cards in the game, already shuffled. The players list corresponds to the list of player names. This function allows the action of distributing nb_card cards from the pickaxe to each of the players. She builds a djeux dictionary whose keys are the names of the players and associating with each name the list of cards corresponding to her game. We will make sure to sort the game of each player in ascending order using the spell function. The distribute_card function returns the dictionary and modifies its pickaxe argument by edge effet (cards dealt to players must be removed from the pickaxe). It is assumed here that the pickaxe contains sufficiently cards for all players.

For example

card = [74, 72, 59, 82, 44, 77, 17, 11, 62, 97, 83, 69, 100, 22, 4, 51, 55, 50, 103, 52, 13, 25, 38, 37, 29, 104, 47, 23, 39, 80, 49, 98, 8, 78, 26, 46, 86, 18, 93, 31, 27, 34, 85, 84, 76, 87, 65, 35, 81, 79, 101, 66, 20, 91, 73, 16, 102, 42, 40, 70, 90, 7, 6, 64, 14, 67, 43, 12, 58, 1, 63, 2, 75, 32, 48, 96, 3, 15, 99, 68, 53, 61, 56, 92, 36, 28, 19, 5, 24, 45, 57, 94, 21, 54, 88, 33, 10, 71, 30, 95, 9, 41, 60, 89]

players = ['rara', 'riri', 'rere']

 

distribute_cartes(card,players,nb_card=10)

#return =>

{'rara': 74, 72, 59, 82, 44, 77, 17, 11, 62, 97, 'riri': 83, 69, 100, 22, 4, 51, 55, 50, 103, 52 , rere: 13, 25, 38, 37, 29, 104, 47, 23, 39, 80}

 

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY