University of Nairobi Create a Python Code Computer Coding Task
Description
you will be using lists and reading files. This assignment will not have an autograder. There will be only two questions and you will need to create and submit assignment6.py. Please answer the following prompts:
All answers must be in a form of a function.
1- Population
Your function will have to read USPopulation.txt (the file is attached to the assignment). The file contains the midyear population of the United States, in thousands, during the years 1950 through 1990. The first line in the file contains the population for 1950, the second line contains the population for 1951, and so forth. Write a function that reads the file’s contents into a list. The function should return the following data:
The average annual change in population during the time period
- The year with the greatest increase in population during the time period
- The year with the smallest increase in population during the time period
- 2- Whos the Best MLB Team
Your function will have to read WorldSeriesWinners.txt (the file is attached to the assignment). This file contains a chronological list of the World Series-winning teams from 1903 through 2009. (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 2009. Note the World Series was not played in 1904 or 1994.) Write a function that returns the following:
A list of all the teams (no duplicates)
- Print how many times each team won
- You’ll have to create assignment5.py and submit it. There is no input() allowed. the assignment6.py must include:
if __name__ == “__main__”:
You must call your function and test. if your code doesn't run you will lose points, if these steps aren't met you will lose points. These should be all functions.
Have a similar assignment? "Place an order for your assignment and have exceptional work written by our team of experts, guaranteeing you A results."