# Write a function that accepts six project scores. # All scores are out of 100 points, # except the first (which is out of 30), # and the fifth (which is out of 50). # The function provides the highest average grade (as integer) # for all the projects by dropping the one with # the lowest percentage. For example, if a student got # a 65% on the first project (out of 30) and # a 55% on the fifth project (out of 50), # that fifth project would be dropped from the average calculation. def template(n1, n2, n3, n4, n5, n6): result = 0 n1 = (n1 * 100) / 30 # percentage n5 = (n5 * 100) / 50 # percentage temp = n1 # running number, so we can decide which one is the lowest if temp > n2: temp = n2 # the current lowest we have been checking if temp > n3: temp = n3 # the current lowest we have been checking if temp > n4: temp = n4 # the current lowest we have been checking if temp > n5: temp = n5 # the current lowest we have been checking if temp > n6: temp = n6 # the current lowest we have been checking # Question: why do we use sequential if statements? # Can we use if-else or if-elif-else? How should we modify the code? total = n1 + n2 + n3 + n4 + n5 + n6 - temp result = total / 5 # average, compute from (total - dropped prpoject) / 5 projects remaining return int(result) # END OF YOUR CODE test1 = template(0, 100, 100, 100, 50, 100) test2 = template(30, 0, 100, 100, 50, 100) test3 = template(30, 100, 0, 100, 50, 100) test4 = template(30, 100, 100, 0, 50, 100) test5 = template(30, 100, 100, 100, 0, 100) test6 = template(30, 100, 100, 100, 50, 0) test7 = template(15, 55, 55, 55, 25, 55) if test1 == 100: print("you got it RIGHT!") else: print("Please check your code") if test2 == 100: print("you got it RIGHT!") else: print("Please check your code") if test3 == 100: print("you got it RIGHT!") else: print("Please check your code") if test4 == 100: print("you got it RIGHT!") else: print("Please check your code") if test5 == 100: print("you got it RIGHT!") else: print("Please check your code") if test6 == 100: print("you got it RIGHT!") else: print("Please check your code") if test7 == 54: print("you got it RIGHT!") else: print("Please check your code")