Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Problem Write a function called best_team that takes a csv file as a parameter. Read the comma-delimited CSV file specified by the variable mlb_data.

4.

Problem Write a function called best_team that takes a csv file as a parameter. Read the comma-delimited CSV file specified by the variable mlb_data. The CSV file has a list of all of the MLB teams and their performance from the 2019 season. The function should return the team name for the team with the most wins. Important, the CSV file has a header of Tm,Lg,G,W,L, which stands for team name, league, games played, wins, and losses. Below are the file name and file path variables you will need for this exercise.

mlb_data = "student_folder/.exercises/mlb_data.csv" 

Expected Output The function call should look like this, best_team(file), and the function should return HOU. However, your function will be tested with other CSV files in which different teams will have the highest win total.

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

Step: 3

blur-text-image

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions