1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
bezimeni [28]
3 years ago
6

Define a function below called process_grades. The function takes one argument: a list of integers. Each integer in the list cor

responds to a student's grade in a class. Complete the function such that it returns a new list where the integer grades are replaced by letter grades. For this question, use a standard grading scale without +/- grade, as follows A: 90-100 B: 80-89 C: 70-79 D: 60-69 F: < 60 For example, given the list [90, 85, 85, 72], the function should return ['A','B','B','C'].
Computers and Technology
1 answer:
stealth61 [152]3 years ago
8 0

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.

You might be interested in
Can you help me solve this challenging activity?
diamong [38]

Answer:

user_age = int(input())

if user_age > 17 and user_age != 25:

   print("Eligible")

else:

   print("Not eligible")

Explanation:

3 0
1 year ago
What number is needed to complete the pattern 66, 73, 13, 21, 52,_, 10, 20?
Lilit [14]
66,73 73-66=7
13,21 21-13=8
10,20 20-10=10

the missing no. is 9 so
52+9=61.

the pattern is
66,73,13,21,52,61,10,20





8 0
2 years ago
The highlighted items in the webpage are called …………………………………..
seraphim [82]

Answer:

highlighted items in webpage are called links.

5 0
3 years ago
Which ofthe following calls on human feelings, basing the argument onaudience needs or sympathies?
Artyom0805 [142]

Answer: a) Emotional appeal

Explanation: Calls on feeling of human is referred as the emotion of the humans ,thus it is said to be an emotional appeal. Other appeals in the options are for the call on technical,logical or unexpected error reason and does not relate to the human audience needs or sympathies .But emotional appeal deals with these need on being called.  So, option (a) is the correct option .

5 0
3 years ago
Why is it helpful that the ribbon tabs can collapse?
Verizon [17]
<span>The 'Pin the ribbon' button replaces the 'Collapse the Ribbon' button when the ribbon is collapsed. You will see the 'Pin the ribbon' button only when you expand a ribbon by tapping or clicking a tab.</span>
4 0
2 years ago
Other questions:
  • Every preprocessing directive must begin with:
    11·1 answer
  • Amy has decided to use a dark background and light colored text for her prensentation. Which toolbar option will let her change
    5·1 answer
  • Which of these is an example of an integrated presentation?
    10·1 answer
  • Which note-taking method quickly captures and organizes information?
    9·2 answers
  • Describe the following types of data hazards. RAW WAR WAW
    13·1 answer
  • Write a program that allows the user to enter the last names of five candidates in a local election and the votes received by ea
    12·1 answer
  • The first numerical control machine tool was demonstrated in 1952 in the United States at the Massachusetts Institute of Technol
    14·1 answer
  • Which of the following is NOT a reason to include comments in programs
    10·2 answers
  • 1. Why do you need to take care of your computer? (Remember: Answer must include 3-5 sentences.)
    13·1 answer
  • You are creating a query for a website. The query
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!