You can test this project using Online Python Editor and IDE
Write a program that displays 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.
The following list holds the population counts as at the end of the year, for six years, starting in 2012.
population = [34372, 37821, 45673, 67100, 69100, 70245]
Your program contains the following data lists:
studentName = ["Terry", "John", "Susan", "Rondell", "Aaron", "Kalifa"]
studentGrade = [[79, 85, 82], [65, 69, 73], [91, 93, 80], [45, 70, 81], [83, 85, 80], [90, 93, 82]]
These data lists contain the names of students and the corresponding set of grades for each student.
Create the following functions:
calculateAverage(studentName): returns the average of a student's grades according to the name supplied.
lowestGrade(studentName): returns the lowest grade for a student according to the name supplied.
highestGrade(studentName): returns the highest grade for a student according to the name supplied.
Then, in a main() function, write code that accepts a name from the user, and displays the following text, with the corresponding data:
Name:
Lowest Grade:
Highest Grade:
Average Grade:
The following dictionary contains the list of US states with their abbreviations as keys and full names as values:
states = {
'AK': 'Alaska',
'AL': 'Alabama',
'AR': 'Arkansas',
'AS': 'American Samoa',
'AZ': 'Arizona',
'CA': 'California',
'CO': 'Colorado',
'CT': 'Connecticut',
'DC': 'District of Columbia',
'DE': 'Delaware',
'FL': 'Florida',
'GA': 'Georgia',
'GU': 'Guam',
'HI': 'Hawaii',
'IA': 'Iowa',
'ID': 'Idaho',
'IL': 'Illinois',
'IN': 'Indiana',
'KS': 'Kansas',
'KY': 'Kentucky',
'LA': 'Louisiana',
'MA': 'Massachusetts',
'MD': 'Maryland',
'ME': 'Maine',
'MI': 'Michigan',
'MN': 'Minnesota',
'MO': 'Missouri',
'MP': 'Northern Mariana Islands',
'MS': 'Mississippi',
'MT': 'Montana',
'NA': 'National',
'NC': 'North Carolina',
'ND': 'North Dakota',
'NE': 'Nebraska',
'NH': 'New Hampshire',
'NJ': 'New Jersey',
'NM': 'New Mexico',
'NV': 'Nevada',
'NY': 'New York',
'OH': 'Ohio',
'OK': 'Oklahoma',
'OR': 'Oregon',
'PA': 'Pennsylvania',
'PR': 'Puerto Rico',
'RI': 'Rhode Island',
'SC': 'South Carolina',
'SD': 'South Dakota',
'TN': 'Tennessee',
'TX': 'Texas',
'UT': 'Utah',
'VA': 'Virginia',
'VI': 'Virgin Islands',
'VT': 'Vermont',
'WA': 'Washington',
'WI': 'Wisconsin',
'WV': 'West Virginia',
'WY': 'Wyoming'
}
Write a program that randomly displays an abbreviation from this list,
and then asks the user to enter the full name that matches that abbreviation. Once the user guesses,
let the user know whether they are correct or incorrect.
If they are incorrect, display the correct answer to the user.
- Write MORE Tests
- Add Night Mode
MIT Free Software, Thanks!