Here is the required python function and the program usage of the same. In case of any queries do write in the comments.
list_avg.py
def avg_list( list ): #Function to calculate average
m_count = 0;
m_sum = 0;
for x in list:
if (x > 80): #In case the value in list is more than 80
m_count+=1; #Increase count of such values by 1
m_sum+=x; #Add to sum of such numbers
m_avg = m_sum/m_count; #Calculate average
return m_avg; #Return average value
m_list = [32,87,80,90,67,50,100];
average = avg_list(m_list); #Pass the list above to function avg_list
print(“Average of numbers greater than 80 in the list: %.2f”%average); #output the average calculated rounded off to 2 decimal digits