Question 1: Soccer roster generator Imagine you have been given a list of 22 soccer players...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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. 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.
Expert Answer:
Answer rating: 100% (QA)
Here are three versions of the soccer roster generator implemented in Python Version 1 Using lists import random Original data players James 1 Robert ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Machine Learning do using python on jupyter notebook 1. Linear Regression Dataset used: Diabetes from sklearn You are asked to solve a regression problem in the Diabetes dataset. Please review the...
-
Machine Learning do it using python i jupyter notebook 1. Logistic Regression Dataset used: Breast Cancer load from sklearn You are asked to solve the classification problem in the Breast Cancer...
-
Machine Learning do using python on jupyter notebook 1. Linear Regression Dataset used: Diabetes from sklearn You are asked to solve a regression problem in the Diabetes dataset. Please review the...
-
Black & Decker, the maker of small, hand-held power tools, finds that when it builds a plant in a foreign country, sales of both its locally manufactured products and its exports to that country...
-
Let \(Z\) be a Brownian motion defined in [0,T]. Given a partition \(\mathscr{P}\) such that \(0=t_{0}
-
List and briefly explain the types of organizational structure.
-
Abourne Ltd manufactures a microcomputer for the home use market. The management accountant is considering using regression analysis in the annual estimate of total costs. The following information...
-
Various information gathering techniques can be used. These are generally categorised as either active or passive reconnaissance. Perform the following tasks on information gathering: 2.2 Packet...
-
Monica wishes to assess whether she should invest in both or only one of the investments listed below. Her required annual rate of return is 8%. What would you recommend to Monica? Investment Q...
-
When finalizing system requirements, it is helpful to return to previous parts of the SDLC and the design specifications. In this case, we want to review requirements related to architecture design....
-
There have been several high-profile scandals in accounting in recent times, which have contributed to the raised profile of ethics and integrity in accounting. The details of many of these scandals...
-
Identify two guidelines for using social media responsibly as an employee.
-
According to the market research organization Bazaarvoice, 71 percent of consumers who read a companys response to an online review change their opinion of the company.168 Explain why a companys...
-
Assume that you work for a company that manufactures luggage. The company would like to design a new line of luggage that meets the needs of business travelers who fly frequently. You have been...
-
Assume that you are interested in getting a masters degree in accounting in your state or a nearby state. Design a search string for Google that will help you identify available programs. How would...
-
What would be the average time to access 1 byte of data if 45% of memory accesses are at level 1, time to access level 1 memory is 0.05 Nano second and 0.09 to access level 2 memory?
-
In Exercises evaluate the limit, using LHpitals Rule if necessary. lim 07x cos x X
-
Professor Wendy Smith has been offered the following deal: A law firm would like to retain her for an upfront payment of $50,000. In return, for the next year the firm would have access to eight...
-
Your company currently has $1000 par, 6% coupon bonds with ten years to maturity and a price of $1078. If you want to issue new ten-year coupon bonds at par, what coupon rate do you need to set?...
-
Gillette Corporation will pay an annual dividend of $0.65 one year from now. Analysts expect this dividend to grow at 12% per year thereafter until the fifth year. After then, growth will level off...
-
Increasing the density of a material tends to increase the index of refraction. Does light travel faster in seawater or in fresh water?
-
If you look through a piece of very fine fabric at a tiny white light source, you will see a rainbow pattern. Explain the source of the pattern.
-
If you look at the light spectrum reflected from the surface of a DVD compared to the spectrum reflected from the surface of a CD, youll see that the rainbows from the DVD are more spread out, with...
Study smarter with the SolutionInn App