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
Which one of these are a valid IPv4 address? Check all that apply.
Illusion [34]
The answer is C.54.45.43.54
6 0
2 years ago
Small programs called _______ are used to communicate with Paris Friel devices such as monitors printers portable storage device
algol13

the answer is D drivers

7 0
3 years ago
Shaniya has misspelled a scientific name in her biology report. She needs to correct it, but she has no access to a computer. Sh
Sav [38]

Answer:

Selection of answers:

Yes, she can navigate the window and do simple editing.

Yes, she can use this application for free and navigate the window.

No, her document is “Read-Only,” so she cannot navigate the window.

No, her application has limited features and she cannot access the document.

Answer is: No, her document is “Read-Only,” so she cannot navigate the window.

3 0
3 years ago
What is analog computer? where is it used​
hichkok12 [17]

Explanation:

analogue computer is in computer which is used to process analogue data.

Analogue computer were widely used in scientific and industrial application

3 0
2 years ago
Read 2 more answers
You can post a Facebook status update from your smartphone. True or false?
Nady [450]
True .................
3 0
3 years ago
Read 2 more answers
Other questions:
  • Tommy has hired a marketing company to create a billboard advertisement
    11·2 answers
  • A power supply unit for a computer converts:
    7·1 answer
  • HELP 25 POINTS!!!!!
    6·2 answers
  • Given the strings s1 and s2 that are of the same length, create a new string consisting of the first character of s1 followed by
    12·1 answer
  • "Write a class named Car that has the following data attributes:" _ _year_model (for the car’s year model) _ _make (for the make
    12·1 answer
  • Which window allows you to view and change your computer's system information and settings?
    9·2 answers
  • ______ is a customer-facing CRM application.<br><br> FAQ<br><br> Search<br><br> SFA<br><br> E-mail
    6·1 answer
  • 1 punto
    11·1 answer
  • What is the total number of time zones that can be configured to show by default in a calendar in Outlook 2016?
    13·1 answer
  • You are given a list of N integers . find the largest sum of a continuous sequence from the given list
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!