Suppose you are given a list of marks, please write a function filter_mark(marks, grade) that takes...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Suppose you are given a list of marks, please write a function filter_mark(marks, grade) that takes a list of marks as input and return a list contianing only the marks of the specified grade. For example, filter_mark ([30, 20, 60, 78], 'F') should return [30, 20]. Because only 30 and 20 are F grades. def filter_mark (li, grade): # INSERT YOUR CODE BELOW #*** #EXAMPLE TESTING CASES # DO NOT CHANGE filter_mark([10, 20, 30, 40], 'F') # return [10, 20, 30, 40] filter_mark ([33, 28, 89, 85, 50], "HD') # return [89, 85] wwwww Suppose you are given a list of marks, please write a function filter_mark(marks, grade) that takes a list of marks as input and return a list contianing only the marks of the specified grade. For example, filter_mark ([30, 20, 60, 78], 'F') should return [30, 20]. Because only 30 and 20 are F grades. def filter_mark (li, grade): # INSERT YOUR CODE BELOW #*** #EXAMPLE TESTING CASES # DO NOT CHANGE filter_mark([10, 20, 30, 40], 'F') # return [10, 20, 30, 40] filter_mark ([33, 28, 89, 85, 50], "HD') # return [89, 85] wwwww
Expert Answer:
Related Book For
Introductory Econometrics A Modern Approach
ISBN: 978-0324660548
4th edition
Authors: Jeffrey M. Wooldridge
Posted Date:
Students also viewed these programming questions
-
Solve in python Q3: Filter a list (20 marks) Suppose you are given a list of marks, please write a function filter_mark(marks, grade) that takes a list of marks as input and return a list contianing...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
"""A BARD DAY'S NIGHTa.k.a. BARD ROCK CAFEa.k.a. THE SCHOOL OF BARD KNOCKSa.k.a. A BARD RAIN'S A-GONNA FALL""" # Imports from typing import Optional, TextIO, Dict, Set, List,Tuple # Specific...
-
2. National Defense (40 points). There are 11 countries in Europe who get utility from general consumption c, and from European national defense G. The utility of a generic country i is u(ci, G) =...
-
Rucky Company and Stone Company experienced the exact same set of economic events during 2010. Both companies purchased machines on January 1, 2010. Except for the effects of this purchase, the...
-
Colt Company reports pretax financial income of $143,000 in 2019. In addition to pretax income from continuing operations (of which revenues are $295,000), the following items are included in this...
-
What are the central dynamics that characterize matrilineal kinship systems?
-
Northern Highlands Railroad Company is evaluating three capital investment proposals by using the net present value method. Relevant data related to the proposals are summarized as follows:...
-
Using the following Information prepare a bank reconciliation: Bank Balance: Book Balance : Deposit in Transit: Outstanding Checks: Interest Income: NSF Check: What is the adjusted book balance? What...
-
Pacific Cruise Lines is a defendant in litigation involving a swimming accident on one of its three cruise ships. Required: For each of the following scenarios, determine the appropriate way to...
-
The curve implicitly define by (y + 1)(x + 1) = 2 with x [0, 1] is shown below. (a) Find an expression for (0,1) (0,-1) (1.0) dy dx for any point (x, y) on the curve (with y # 0) in terms of x and...
-
A \(1000-\mathrm{kg}\) car traveling with an \(x\) component of velocity of \(+20 \mathrm{~m} / \mathrm{s}\) collides head-on with a \(1500-\mathrm{kg}\) light truck traveling with an \(x\) component...
-
The circuit shown in Figure Q26.28 has a resonance frequency of \(15 \mathrm{kHz}\). What is the value of \(L\) ? A. \(1.6 \mu \mathrm{H}\) B. \(2.4 \mu \mathrm{H}\) C. \(5.2 \mu \mathrm{H}\) D. \(18...
-
Two cars collide head-on on a busy street. An observer standing on the street witnesses the accident and calculates how much of the cars' initial kinetic energy went into deforming the cars upon...
-
A world-class sprinter running a 100 m dash was clocked at 5.4 m/s 1.0 s after starting running and at 9.8 m/s 1.5 s later. In which of these time intervals, 0 to 1.0 s or 1.0 s to 2.5 s, was his...
-
Write a program that displays the following menu: If the user enters 1, the program should ask for the radius of the circle and then display its area. Use the following formula to calculate the...
-
Schein primary and secondary mechanisms through which organizational culture is embedded and transmitted. Describe the ways in which these mechanisms are used working at UPMC and which one you find...
-
The registrar of a college with a population of N = 4,000 full-time students is asked by the president to conduct a survey to measure satisfaction with the quality of life on campus. The following...
-
In the example in equation (7.29), suppose that we define outlf to be one if the woman is out of the labor force, and zero otherwise. (i) If we regress outlf on all of the independent variables in...
-
The data set BWGHT.RAW contains data on births to women in the United States. Two variables of interest are the dependent variable, infant birth weight in ounces (bwght), and an explanatory...
-
Use the data in TRAFFIC2.RAW for this exercise. Computer Exercise C10.11 previously asked for an analysis of these data. (i) Compute the first order autocorrelation coefficient for the variable...
-
For a reversible process, change in entropy of the system (a) Approaches to zero (b) Increases (c) Decreases (d) Remains constant
-
For a multi-component system, the chemical potential is equivalent to (a) Molar free energy (b) Molar concentration difference (c) Molar free energy change (d) Partial molar free energy
-
A domestic refrigerator consists of (a) A condenser, a compressor and an evaporator (b) A condenser, a throttling valve, a compressor and an evaporator (c) A condenser, a throttling valve and an...
Study smarter with the SolutionInn App