Write a function in Python to find the index of a given element in a given list of numbers.
def find_index(nums, element):
    for i, num in enumerate(nums):
        if num == element:
            return i
    
    return -1