Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1: Soccer roster generator Imagine you have been given a list of 22 soccer players along with their performance scores (out of 11):

 
image
image
image

Question 1: Soccer roster generator Imagine you have been given a list of 22 soccer players along with their performance scores (out of 11): Player Name Performance Score (PS) James 1 Robert 2 3 4 John Michael David William Richard Joseph Thomas Charles Christopher Mary Patricia Jennifer Linda Elizabeth Barbara Susan Jessica Sarah Karen Lisa 5 6 7 10 11 8 9 10 11 1 2 3 The coach wants you to develop a random roster generator that operates in a fair way. Meaning, upon every execution of your code, it must output two random lineups (each composed of 11 players) such that no two players with the same performance scores be in the same team. For example, one output can be: Or, another output can be Team 1 PS Team 2 PS Mary 1 James 1 Robert 2 Patricia 2 John 3 Jennifer 3 Michael 4 Linda 4 5 David 5 Elizabeth Wan 6 Barbara 6 Richard 7 Susan 7 Joseph 8 Jessica 8 Thomas 9 Sarah 9 Charles 10 Karen 10 Christopher 11 Usa 11 Team 1 PS Team 2 PS James 1 Mary 1 Patricia 2 Robert 2 John 3 Jennifer 3 4 Linda 4 David 5 Elizabeth 5 Wa 6 Barbara 6 Richard 7 Susan 7 Joseph Jessica 8 Thomas 9 Sarah Micha 8 9 Or, another output can be Thomas 9 Charles 10 Christopher 11 Sarah 9 Karen 10 Lisa 11 Team 1 PS Team 2 PS James 1 Mary 1 Patricia 2 Robert 2 Unda 4 5 6 John 3 Jennifer 3 Michael 4 David 6 Elizabeth William 6 Barbara Richard 7 Susan 7 Jessica 8 Joseph 8 Thomas 9 Sarah 9 Charles 10 Karen 10 Lisa 11 Christopher 11 I need you to write three versions of your code each in a separate celt: 1. Version 1-Use sequence type list for both storing original data and outputing lineups 2. Version 2-Use sequence type tuple for both storing original data and outputing lineups. 3. Version 3- Use pandas dataframe for both storing original data and outputing t lineups. Caveats: 1. Outputted lineups must show not only players names but also their corresponding Performance Scores 2. Your code is supposed to be a random lineup generator meaning the suggested lineups of every execution of your code must be different from previous executions. 3. Random does not mean unique, this is not a problem with infinite number of solutions.

Step by Step Solution

3.42 Rating (155 Votes )

There are 3 Steps involved in it

Step: 1

Here are three versions of the code each using a different data structure and approach Version 1 Usi... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals of Corporate Finance

Authors: Berk, DeMarzo, Harford

2nd edition

132148234, 978-0132148238

More Books

Students also viewed these Programming questions

Question

Create a Fishbone diagram with the problem being coal "mine safety

Answered: 1 week ago