Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python Programming YOU MUST USE LOOPS TO ANSWER THIS QUESTION (NO RECURSION). Assignment 06 Due Wednesday, March 13 at 10:00 am (no late submissions CS
Python Programming
YOU MUST USE LOOPS TO ANSWER THIS QUESTION (NO RECURSION).
Assignment 06 Due Wednesday, March 13 at 10:00 am (no late submissions CS 116 Winter 2019 3 Standings Elmira recently hosted the Ontario curling championships. This problem requires you to take the results of all the games in a tournament like this and determine the team with the most wins. Specifically, write a function most_wins that consumes T and L. The parameter T is a list of distinct strings where T[i] is the name of team i. The parameter L is a nested list containing the results of all the games in the tournament. Specifically, each L[i] [j] is a two element list [x, y] where x and y are natural numbers. If x > y, then we know team i beat team i+j+1. Otherwise, we know team i +j+1 beat team i An example is below. To help you visualize this, note that L corresponds to the upper right portion of the table shown HOMAN AULD HORTON TIPPIN HOMAN AULD HORTON TIPPIN scotties teams C'HOMAN' 'AULD', 'HORTON', 'TIPPIN'] scotties_results The first row gives the scores in all three games played by 'HOMAN'. The second row gives the scores of the other two games played by 'AULD, and the third row gives the score in the game between HORTON' and TIPPIN'.These results are HOMAN 4 AULD 0 HOMAN 7 HORTON 2 HOMAN 5 TIPPIN 1 AULD 3 AULD 8 HORTON 6 TIPPIN 4 HORTON 6 TIPPIN 1 Your function must return the name of the team with the most wins. So, continuing this example most wins (scotties teams, scotties_resultsHOMAN A small second example is most wins(C'EPPING' 'MCDONALD'], CC[4,5]])'MCDONALD' Note: e There will be at least two teams. Every two teams play each other exactly once . No game results in a tie There will always be a unique team with the most wins. 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started