Question
=================================Python============================================ *** World Series Winners *** You are given a text file names WorldSeriesWinners.txt. This file contains a chronological list of the World Series winning
=================================Python============================================
*** World Series Winners ***
You are given a text file names WorldSeriesWinners.txt. This file contains a chronological list of the World Series winning teams from 1903 through
2016 (with the exception of 1904 and 1994 when World Series didn't take place). 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 2016. Write a program that reads and anaylizes this this file and prints the following information:
1) Number of World Series played,
2) Number of World Series champions,
3) The team that won most World Series,
4) The most wins by a single team.
Hints: Your program needs to create 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.
View required output
Test Case 1
Files in the same directory |
---|
WorldSeriesWinners.txt |
Total number of World Series games: 112
Number of World Series champions: 29
The team that won most World Series games: New York Yankees
New York Yankees won 27 times.
==============================================================================================================================================
WorldSeriesWinners.txt
Boston Americans 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 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
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