Answer to Question #259193 in Python for Neel

Question #259193

4.1 Write a program for each of the following:


(a) Listing all students whose CUM is K or higher. (Test the program using K = 3.00.)


(b) Listing all students in year L. (Test the program using L= 2, or sophomore.


1
Expert's answer
2021-10-31T12:08:36-0400
last = ["Adams", "Bailey", "Cheng", "Davis", "Edwards", "Fox"]


cum = [2.55, 3.25, 3.40, 2.85, 1.75, 2.80]


years = [2, 4, 1, 1, 3, 2]




qualified = []
#Function checks whose CUM is equal or above K
def check_CUM(K):
    for names in last:
      if cum[last.index(names)] >= K:
        qualified.append(names)
    print(qualified)
check_CUM(3.00)



        
L_year_Students = []
#Function checks who is L year student
def check_student_year(L):
  for name in last:
    if years[last.index(name)] == L:
      L_year_Students.append(name)
  print(L_year_Students)
check_student_year(2)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog