Answer:
Following are the code in the Python Programming Language.
#define function
def process_grades(std_grades):
result = [] #list type variable
for grades in std_grades: #set for loop
if 90<=grades<=100: #set if statement
lettersGrade = 'A' #variable initialization
elif 80<=grades<=89: #set elif statement
lettersGrade = 'B' #variable initialization
elif 70<=grades<=79: #set elif statement
lettersGrade = 'C' #variable initialization
elif 60<=grades<=69: #set elif statement
lettersGrade = 'D' #variable initialization
else:
lettersGrade = 'F' #variable initialization
result.append(lettersGrade) #append the value of lettersGrade in result
return result #print the value of the variable result
print(process_grades([90, 85, 85, 72])) #call the function
Output:
['A', 'B', 'B', 'C']
Explanation:
Here, we define the function "process_grades" and pass an argument in the parameter list is "std_grades" in which we pass the grades of the students.
Then, we set the list data type variable "result" i9n which we store the grades of the students.
Then, we set the for loop and pass the condition.
Then, we set the "if-elif" statement and pass the conditions as given in the question.
Then, we append the value of the variable "lettersGrade" in the variable "result".
Finally, we call then function.