From Python 3.4+ versions, you can use statistics.mean()
l = [15, 18, 2, 36, 12, 78, 5, 6, 9]
import statistics
statistics.mean(l) # 20.11111111111111
In case of older versions, you can do
sum(l) / len(l)
In case of python 2, you have to convert len to a float.
sum(l) / float(len(l))
Want to learn more about Python? Come and join: python certification course