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]
4 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]4 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
After a CPU decodes an instruction, what is the next step in the execution cycle?
Nat2105 [25]

Answer: E) The CPU executes the instruction by performing ALU operations.

Explanation: The execution cycle is of three stages namely; fetch, decode and execute. These are the functions that the CPU carries out from the time of boot-up up until it's shut down.

At the fetch stage, the computer retrieves program instructions from its memory register, at the decode stage; the decoders interprets the instructions from the instructions register and then the next stage will be the executions, at this stage; the interpreted instructions are then passed to relevant function units of the CPU to carry out the required instructions.

E.g mathematical and logic functions are passed on the ARITHMETIC AND LOGIC UNIT(ALU) to perform.

8 0
3 years ago
A problem with windows is preventing screen snipping
TiliK225 [7]

Answer:

Don't post irrelevant questions.

Also yes it is.

3 0
3 years ago
A type of memory that is expensive and therefore is often used only in cache memory applications.
tatuchka [14]
SRAM [STATIC] is a type of memory, it is five times faster than DRAM [which is found in most computers] and it depends on the use of electricity. It is designed in such a way that its constant refreshing is not require, it is much more expensive than the DRAM and it is therefore only used in cache memory application.<span />
6 0
3 years ago
Read 2 more answers
A _____________________ does not require the user to make an affirmative action to accept the terms of the contract. Agreement i
kompoz [17]

Answer: Browse-wrap contract

Explanation: A browse-wrap contract is the contract in which consumer's review is basic terms of the agreement is not required rather the website provides the agreement through browsing.It is an enforceable agreement which requires the terms and the concept to be the actual in the website and the user's consent is a required after going through that agreement.

3 0
4 years ago
How do I report a user? (https://brainly.com/profile/TheBrainHelper-20043487)
Veseljchak [2.6K]

Answer:

I don't think you can report someone but you always can report the question

7 0
4 years ago
Read 2 more answers
Other questions:
  • What is a method whereby new problems are solved based on the solutions from similar cases solved in the past?
    5·1 answer
  • To change the caption for a field in a query, click the field in the design grid, click the ____ button on the Design tab, click
    14·1 answer
  • Your company is experiencing an increase in malware incidents. Your manager is asking for advice on how best to verify that comp
    12·1 answer
  • 2. Design a class named Sandwich with data fields for description and price. Include a constructor that requires arguments for b
    14·1 answer
  • Checker for integer string (Please answer in C++):
    8·1 answer
  • Greyer Corp, manufactures surgical instruments. Systems Medico Inc. enters into a contractual arrangement with Greyer that allow
    7·1 answer
  • String member function compare compares two strings (or substrings) and returns 0 if:
    5·1 answer
  • Need answer ASAP!!!!
    14·1 answer
  • Question 1 of 10
    14·2 answers
  • Write a program that simulates applying a "boost" to a spaceship in a spaceship race game.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!