Help me in solving SEARCHINARR problem

My issue

Solution

My code

# cook your dish here
def linearSearch(array,n,x):
    for i in range(0, n):
        if(arr[i]==x):
            return i
            return -1
            array=[7,3,5,2,1]
            x = 1
            n=len(array)
            
            result= lenearSearch(array,n,x)
            if(result==-1):
            print("YES")
            else
            print("NO")
            
        

Learning course: BCS301: Data structures
Problem Link: https://www.codechef.com/learn/course/abesit-dsa/ABESITDS06/problems/SEARCHINARR