Write a code snippet for a search algorithm in Python with linear time complexity.
Not applicable
def linear_search(arr, x): 
    
    for i in range(len(arr)): 
  
        if arr[i] == x: 
            return i 
  
    return -1