Please answer it in Python Write a function init_line that takes as an argument a pickaxe list corresponding to the list of cards after distribution of cards to players. This function removes the first 4 cards from the deck (it is assumed that there are suffisamment) and uses them to start the 4 lines of the game board. It therefore returns a dictionary according to the format defini in part 3 (key = line number, associated value = list of cards in the line). The first card of the pickaxe will go to the first line, and so on. The function also has an edge effet: it modifies pickaxe. 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]   init_line(card) #return=> {‘line 1’: 74, 'line 2':72, ‘line 3’: 59, ‘line 4’: 82}

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

Please answer it in Python

Write a function init_line that takes as an argument a pickaxe list corresponding to the list of cards after distribution of cards to players. This function removes the first 4 cards from the deck (it is assumed that there are suffisamment) and uses them to start the 4 lines of the game board. It therefore returns a dictionary according to the format defini in part 3 (key = line number, associated value = list of cards in the line). The first card of the pickaxe will go to the first line, and so on. The function also has an edge effet: it modifies pickaxe.

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]

 

init_line(card)

#return=> {‘line 1’: 74, 'line 2':72, ‘line 3’: 59, ‘line 4’: 82}

 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 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