Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The medal counts for the gymnastics competitions at the 2 0 1 7 Winter Olympics for the top seven countries are as shown in the
The medal counts for the gymnastics competitions at the Winter Olympics for the top seven countries are as shown in the file Medals.txt depicted below. The three numeric values after each country represent the countrys count of gold, silver and bronze medals respectively. Write a syntactically and structurally correct Python code to: i Retrieve information from the file and store them in appropriate lists. ii create a function that finds the total points scored by each country. One gold is worth points, one silver is worth points, while one bronze is worth one point. Your program should multiply the medal number by the associated points. Eg Since Canada had gold, silver, and bronze, the points will be obtained as follows: Gold points Silver points Bronze points Total points Call this function to compute and print out the list of countrys total points you do not need to print out the country names
The medal counts for the gymnastics competitions at the Winter Olympics for the top seven countries are as
shown in the file Medals.txt depicted below. The three numeric values after each country represent the countrys
count of gold, silver and bronze medals respectively.
Write a syntactically and structurally correct Python code to:
i Retrieve information from the file and store them in appropriate lists.
ii create a function that finds the total points scored by each country. One gold is worth points, one silver is
worth points, while one bronze is worth one point. Your program should multiply the medal number by
the associated points. Eg Since Canada had gold, silver, and bronze, the points will be obtained as
follows:
Gold points
Silver points
Bronze points
Total points
Call this function to compute and print out the list of countrys total points you do not need to print out
the country names
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