def average(numberList): try: total=0 length=len(numberList) #len finds the length of a list for i in range(length): #adds up the numbers total=total+numberList[i] return total/length #returns the final total except: #is only executed if an error occurs return "error"