people = [{'name': 'Mary', 'height': 160},{'name': 'Isla', 'height': 80},
{'name': 'Sam'}] height=0 n=0 for i in range(len(people)): if isinstance((people[i].get('height')),int): n=n+1 height=people[i].get('height')+ height else: print('人员的平均身高为%s'% (height/n))