Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The medal counts for the gymnastics competitions at the 2017 Winter Olympics for the top seven countries are as shown in the file Medals, txit

image text in transcribed
The medal counts for the gymnastics competitions at the 2017 Winter Olympics for the top seven countries are as shown in the file Medals, txit depicted below. The three numeric values after cach country represent the country's count of gold, silver and bronze medals respectively. Medals - Notepad Bile Eoit Format Yiew Help 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 3 points, one silyer is worth 2 points, while one bronze is worth one point. Your program should multiply the medal number by the associated points. E.g. Since Canada had 2 gold, 2 silver, and 3 bronze, the points will be obtained as follows: Gold points =23=6 Silver points =22=4 Bronze points =31=3 Total points =6+4+3=13 Call this function to compute and print out the list of country's total points (you do not need to ptint out the country names) iii. Create additional code that computes and prints the standard deviation of the total points based on the following formula: n18(xix)2 where x represents the individual total points, n is the number of countries, while x is the mean of the

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

More Books

Students also viewed these Databases questions