Generate a python program to find the minimum element of a list.
[1, 7, 4, 8, 2]
def find_min(input_list):
    min_ele = input_list[0]
    for ele in input_list:
        if ele < min_ele:
            min_ele = ele
    return min_ele