Question: use python)1. Inside the main function, define the following two lists: A list of strings called StudentsNames which contains the following names: [ALEX, TOM, JOHN,

use python)1. Inside the main function, define the following two lists: A list of strings called StudentsNames which contains the following names:

["ALEX", "TOM", "JOHN", "MARY", "STEVEN"]

A list of integers called StudentsGrades which contains the following grades:

[40, 70, 45, 90, 100]

2. Now, define the following three functions:

a. Define a function called FailedStudents which receives 2 parameters (the two lists defined above) and it returns back a List of strings. The function starts by defining an empty list, then the function tests the students grades list item by item to check if the student failed or not. If the student fails, then add a string to the empty list, where the string has the students name and his/her grade. The string should have the students name in a small letter format then, got his/her grade out of 100 using the following format: StudentName got

StudentGrade% out of 100%

To determine the failing students, their grade should be less than 50.

b. Define a function called TestAverage which receives 2 parameters (the two lists defined above) and returns back a sorted List of students names who got grade above the average. The lists should be sorted alphabetically based on the students names.

c. Define a main function which first defines the two lists above (step 1) then it calls the two functions above and it prints the results of the functions call as you can see below. Sample run of the program:

******************************************************************************

Students who failed in the test:

******************************************************************************

Alex got 40% out of 100% John got 45% out of 100%

******************************************************************************

Students who got above the Average:

******************************************************************************

Mary Steven Tom

******************************************************************************

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!