I am new to python and I am trying to count the number of males and females in a list and that worked but I do not know how to make the average of all the ages in the list.
user_list = [
{'name': 'Alizom_12',
'gender': 'f',
'age': 34,
'active_day': 170},
{'name': 'Xzt4f',
'gender': None,
'age': None,
'active_day': 1152},
{'name': 'TomZ',
'gender': 'm',
'age': 24,
'active_day': 15},
{'name': 'Zxd975',
'gender': None,
'age': 44,
'active_day': 752},
]
def user_stat():
from collections import Counter
counts = Counter((user['gender'] for user in user_list))
print(counts)
user_stat()