Home /
Expert Answers /
Computer Science /
solve-this-by-python-question-1d-in-this-question-you-need-to-fill-in-the-missing-program-lines-b-pa305
(Solved):
solve this by python
Question 1d In this question you need to fill in the missing program lines b ...
solve this by python
Question 1d In this question you need to fill in the missing program lines between the comments to achieve the required functionality. Do not edit the code outside of those comments. Remember to "Mark" your code for every question, before the end of the test. The required functionality: Read the file 'scores.csv', and print out each team's name in the file that scored more than 10. The file is structured with a team's name and score on a line, separated by a comma. Please print the output in the same format as shown in the example result from the given file below: 1 High scorer: Blue Team - 11 2 High scorer: Yellow Team - 20 If you accidentally edit the code incorrectly and want to get back to the original state, here is the unmodified code: teams_dict \( =\{\} \) # teams_dict is a dictionary # key is of type string, the name of a team that scored more than 10 # value is of type int, the score that team had for line in open("scores.csv"): values \( = \) line.rstrip(' \( \left.\backslash n^{\prime}\right) \cdot \operatorname{split}\left({ }^{\prime},{ }^{\prime}\right) \) name \( =\operatorname{values}[0] \) score = int \( ( \) values \( [1]) \) # Fill in the missing code below this line. # Do not modify anything below this line. for team in teams_dict: print("High scorer:", team,"-", teams_dict[team])
1 Red Team, 9 Blue Team,11 Green Team, 10 yellow Team,20 Purple Team, 0