def average(num_list): """ Returns the average of numbers in a list. Returns 0 for an empty list. """ if not num_list: return 0 return sum(num_list) / len(num_list) def remove_duplicates(num_list): """ Returns a list with duplicate elements removed. """ return list(set(num_list)) def count_greater_occurrences(num_list, threshold): """ Counts the occurrences of elements in a list that is greater than a specific threshold. """ count = 0 for item in num_list: if item > threshold: count += 1 return count def sum_squares(num_list): """ Returns the sum of squares of numbers in a list. """ return sum([num * num for num in num_list])