在此任务中，你需要编写一个函数，计算一个整数列表中所有元素的平均值，并返回结果。如果输入不是列表或列表中没有数字，则应该输出一个错误消息。
def average_calc(input_list):
"""Return the average of all elements of input_list"""
# TODO: Implement function
input_list = [10, 20, 30, 40, 50]
Here's one implementation of the average_calc function in Python:

def average_calc(input_list):
    if not isinstance(input_list, list):
        return "Error: input is not a list"
    if len(input_list) == 0:
        return "Error: input list is empty"
    sum = 0
    count = 0
    for num in input_list:
        if isinstance(num, int) or isinstance(num, float):
            sum += num
            count += 1
    if count == 0:
        return "Error: input list contains no numbers"
    return sum / count

# Example usage:
input_list = [10, 20, 30, 40, 50]
print(average_calc(input_list))   # Output: 30.0

This implementation first checks that the input is a list and has at least one element. Then it iterates through each element of the list, summing up all the numbers it encounters and counting how many numbers there are. Finally, it returns the average by dividing the sum by the count. If the input is not a list, or if the list contains no numbers, it returns an error message.