# Compute average of a set of grades # Write a function average_grade that does not take any parameters, # and computes the average of a set of grades # A user should be allowed to type any number of grades # The user should type -1 to indicate that she/he is done # entering the grades # The function should just return the average grade def average_grade(): count = 0 asum = 0 grade = int(raw_input("Please next grade, -1 to quit")) while grade != -1: count += 1 asum += grade grade = int(raw_input("Please next grade, -1 to quit")) if count > 0: return asum / float(count) #every time you divide #think what IF denominator = 0.... return 0