text_plain_output_1.png
def sequentialSearch(x, array):
    position = 0
    global iterations
    iterations = 0
    while position < len(List):
        iterations += 1
        if Target == List[position]:
            return position
        position += 1
    return -1
if __name__ == '__main__':
    List = ['10', '20', '30', '40', '50', '60', '70']
    Target = '50'
    answer = sequentialSearch(Target, List)
    if answer != -1:
        print('Target ditemukan diindex :', answer, 'melalui', iterations, 'iterasi')
    else:
        print('Target tidak ditemukan')