we want to find the average of items of the list. List is given below
marks=[45,87,45,56,54]
print(sum(marks)/len.marks())
CodePudding user response:
marks=[45,87,45,56,54]
print(sum(marks)/len(marks))
CodePudding user response:
You can try to use this:
marks = [45,87,45,56,54]
def avg(l):
return sum(l) / len(l)
print(avg(marks))