Write a Python program to find the index of the first occurrence of the given element in the given list.
inputlist = [1, 2, 5, 8, 10, 9]
element = 8
def find_element(inputlist, element):
    for i, num in enumerate(inputlist):
        if element == num:
            return i