Search for question
Question

In this program assignment, you will use a text file named World Series.txt. This file contains a chronological list of the World Series' winning teams from 1903 through 2022. The first

line in the file is the name of the team, Boston Americans, that won in 1903, and the last line is the name of the team, Houston Astros, that won in 2022. Note the World Series was not played in 1904 and 1994. (There are entries "World Series Not Played in xxxx" in the file indicating this.) Write a program that reads this file and creates TWO dictionaries. The keys of the first dictionary 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 keys of the second dictionary are the years, and each key's associated value is the name of the team that won that year. Next display the teams that won 5 or more times in descending order. A sample looking could be as: Top Five of World Series champions: Team Name Winning Times New York Yankees 27 St. Louis Cardinals 11 Boston Red Sox 8 Los Angeles Dodgers Хххххх Ххххх ------ 6 5/nAfter you complete the part above, the program should then prompt the user to enter a year in the range of 1903 through 2022. 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. If the user input 1904 or 1994, the program should tell user that "the World Series was not played in xxxx". If user input is out of the year range of 1903- 2021, display a reminder and allow user to re-input. The program should allow a user to play multiple times. Remind user how to terminate/stop the program. Your program must have at least three functions, including main(), the starting function of the program, created by you in the program.

Fig: 1

Fig: 2