Produce a program in Python to search for an element in a list
[2, 3, 4, 5, 6]
# function to search an element  
# in a list 
def linear_search(list, x): 
    for index, element in enumerate(list): 
        if element == x: 
            return index 
    return -1