text_plain_output_1.png
def linearSearch(array, n, x):
    for i in range(0, n):
        if array[i] == x:
            return i
    return -1
array = [10, 20, 30, 40, 50, 60, 70]
x = 50
n = len(array)
result = linearSearch(array, n, x)
if result == -1:
    print('Element not found')
else:
    print('Element found at index: ', result)