#write a function average that has three parameters and return average of #parameters #write a program that reads grades in three courses for 2 students #and finds average grade for each student. #write a function that checks validity of the input #is_valid has three parameters, and returns True is parameters are valid #and False otherwise def average(a,b,c): return (a+b+c)/3 def is_valid(a,b,c): value1=((a>=0) and (a<=100)) value2=((b>=0) and (b<=100)) value3=((c>=0) and (c<=100)) if(value1 and value2 and value3): return True else: return False def main(): counter=1 print("student #", counter) g1=int(input("grade 1 ")) g2=int(input("grade 2 ")) g3=int(input("grade 3 ")) print("average grade for student", counter, "is", average(g1,g2,g3)) counter=counter+1 g1=int(input("grade 1 ")) g2=int(input("grade 2 ")) g3=int(input("grade 3 ")) print("average grade for student", counter, "is", average(g1,g2,g3)) main()