# 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). # # If any project score is not given, # the function assumes that project's score is zero (0). # (hint: think about "default value") # # 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( ..... you fill parameters .... ): # END OF YOUR CODE test1 = template(n2=100, n3=100, n4=100, n5=50, n6=100) # why don't we pass in n1=0 ? test2 = template(n1=30, n3=100, n4=100, n5=50, n6=100) test3 = template(n1=30, n2=100, n4=100, n5=50, n6=100) test4 = template(n1=30, n2=100, n3=100, n5=50, n6=100) test5 = template(n6=100, n1=30, n2=100, n4=100, n3=100) test6 = template(n2=100, n3=100, n4=100, n5=50, n1=30) test7 = template(n2=55, n3=55, n4=55, n6=55, n1=15, n5=25) test8 = template(n5=25, n4=100, n6=100) # pass in 4 arguments (without name, i.e., positioning) # use defaults for the remaining parameters (i.e., n5 and n6) test9 = template(25, 90, 90, 100) # Notice that, from the above function call, # we cannot use defaults of n1 and n2. # This is because calling function without using named arguments # requires arguments to be passed in order. # Therefore, if a function definition has 6 parameters, # (from this function call) the first 4 parameters # will get the values being passed in # and the defaults will be used for the remaining parameters. # Good practice: when there are default values, make use of them # --> use the maximum number of defaults if test1 == 100: print("test1", test1, "You got it RIGHT!") else: print("test1", test1, "Please check your code") if test2 == 100: print("test2", test2, "You got it RIGHT!") else: print("test2", test2, "Please check your code") if test3 == 100: print("test3", test3, "You got it RIGHT!") else: print("test3", test3, "Please check your code") if test4 == 100: print("test4", test4, "You got it RIGHT!") else: print("test4", test4, "Please check your code") if test5 == 100: print("test5", test5, "You got it RIGHT!") else: print("test5", test5, "Please check your code") if test6 == 100: print("test6", test6, "You got it RIGHT!") else: print("test6", test6, "Please check your code") if test7 == 54: print("test7", test7, "You got it RIGHT!") else: print("test7", test7, "Please check your code") if test8 == 50: print("test8", test8, "You got it RIGHT!") else: print("test8", test8, "Please check your code") if test9 == 72: print("test9", test9, "You got it RIGHT!") else: print("test9", test9, "Please check your code")