Question: World Series Program - Python In this program assignment, you will find a text file named WorldSeries.txt. This file contains a chronological list of the

World Series Program - Python

In this program assignment, you will find a text file named WorldSeries.txt. This file contains a chronological list of the World Series' winning teams from 1903 through 2017. The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2017. (Note the World Series was not played in 1904 and 1994. There are entries in the file indicating this.)

Write a program that reads this file and creates a dictionary in which the keys are the names of the teams, and each key's associated value is the number of times the team has won the World Series. The program should also create a dictionary in which the keys are the years, and each key's associated value is the name of the team that won that year.

Then display the first dictionary in a sorted one with the team won the most of times the 1st row. A sample looking could be as:

New York Yankees : 26 Times

St. Louis Cardinals : 11 Times

Boston Red Sox : 7 Times

New York Giants : 5 Times

Pittsburgh Pirates : 5 Times

Philadelphia Athletics : 5 Times

Cincinnati Reds : 5 Times

Los Angeles Dodgers : 5 Times

Detroit Tigers : 4 Times

Oakland Athletics : 4 Times

Chicago White Sox : 3 Times

The program should then prompt the user to enter a year in the range of 1903 through 2017. It should then display the name of the team that won the World Series that year, and the number of times that team has won the World Series.

The program should allow a user to play multiple times. Remind user how to terminate the program.

Tips:

Must have at least one function created by you in the program

Document/comment your program

Be user friendly

Design your interface

Format your output

PLEASE MAKE SURE ALLOWS THE USER TO PLAY MULTIPLE TIMES.

WorldSeries.txt file contents:

Boston Americans World Series Not Played in 1904 New York Giants Chicago White Sox Chicago Cubs Chicago Cubs Pittsburgh Pirates Philadelphia Athletics Philadelphia Athletics Boston Red Sox Philadelphia Athletics Boston Braves Boston Red Sox Boston Red Sox Chicago White Sox Boston Red Sox Cincinnati Reds Cleveland Indians New York Giants New York Giants New York Yankees Washington Senators Pittsburgh Pirates St. Louis Cardinals New York Yankees New York Yankees Philadelphia Athletics Philadelphia Athletics St. Louis Cardinals New York Yankees New York Giants St. Louis Cardinals Detroit Tigers New York Yankees New York Yankees New York Yankees New York Yankees Cincinnati Reds New York Yankees St. Louis Cardinals New York Yankees St. Louis Cardinals Detroit Tigers St. Louis Cardinals New York Yankees Cleveland Indians New York Yankees New York Yankees New York Yankees New York Yankees New York Yankees New York Giants Brooklyn Dodgers New York Yankees Milwaukee Braves New York Yankees Los Angeles Dodgers Pittsburgh Pirates New York Yankees New York Yankees Los Angeles Dodgers St. Louis Cardinals Los Angeles Dodgers Baltimore Orioles St. Louis Cardinals Detroit Tigers New York Mets Baltimore Orioles Pittsburgh Pirates Oakland Athletics Oakland Athletics Oakland Athletics Cincinnati Reds Cincinnati Reds New York Yankees New York Yankees Pittsburgh Pirates Philadelphia Phillies Los Angeles Dodgers St. Louis Cardinals Baltimore Orioles Detroit Tigers Kansas City Royals New York Mets Minnesota Twins Los Angeles Dodgers Oakland Athletics Cincinnati Reds Minnesota Twins Toronto Blue Jays Toronto Blue Jays World Series Not Played in 1994 Atlanta Braves New York Yankees Florida Marlins New York Yankees New York Yankees New York Yankees Arizona Diamondbacks Anaheim Angels Florida Marlins Boston Red Sox Chicago White Sox St. Louis Cardinals Boston Red Sox Philadelphia Phillies New York Yankees San Francisco Giants St. Louis Cardinals San Francisco Giants Boston Red Sox San Francisco Giants Kansas City Royals Chicago Cubs Houston Astros

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!