[Solved] You are tasked with creating a program that will give statistics regarding the top_100 data
use python language write Code ,show screenshots will be great !
Task 2: Descriptive Statistics Menu (35 marks)
You are tasked with creating a program that will give statistics regarding the top_100 data. The program is to present a console menu that will allow users to give a column and statistic (e.g, “Duration” and “Average”) and receive the appropriate information in return.
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>>
Your code should have the following functionality:
The menu function is to repeatedly ask the user for input until the user enters the value to quit.
The menu is the handle both uppercase and lowercase input.
If a user enters an column that is out of range, then the menu will ask for a valid column.
Only columns with numeric data can be given to Average and Sum, otherwise the menu will ask
for a valid column.
Note: You are NOT allowed to use any built‐in Python functions other than range(), len(),
input(), print(), upper(), int() and isinstance().
Function header: menu(top_100)
Input: top_100: the top_100 table read from the target file and processed in Assignment 1.
Output: Console output. Based on user commands
Below is example output for selecting the minimum of column 3, using the following sample data in
place of the processed top_100 list. The user first inputs an invalid column and is taken back to the main
menu so they may try again. The user then selects minimum again and gives a valid column index and is
then presented with the column minimum. The user then selects quit from the menu.
sample_data = [[4,3,2,9],
[9,8,7,6],
[2,4,6,1],
[1,3,5,7]]
menu(sample_data)
Examples:
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>> 1
Minimum
Enter a column index:
>>> 10
Please enter a valid index.
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>> 1
Minimum
Enter a column index:
>>> 3
1
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>> H
To select an option, press enter the key corresponding to the menu option.
e.g 1 for Minimum.
Then enter a valid column index. Note, it is invalid to get the average and
sum of string data
Top 100 Information Centre
##########################
1. Minimum
2. Maximum
3. Average
4. Sum
H. Help
Q. quit
>>> Q
Process finished with exit code 0
Expert Answer
OR