[Python] Whats wrong? The PyCharm doesnt give any output

Discussão em 'Python' iniciado por Stack, Maio 10, 2025.

  1. Stack

    Stack Membro Participativo

    array1 = []
    size = int(input("ENTER SIZE"))
    print("ENTER VALUES")
    for i in range(0,size):
    l = int(input())
    array1.append(l)
    x = int(input("ENTER SEARCH ELEMENT"))
    def linearsearch(array1, size, x):
    pos = -1
    i = 0
    while i < size:
    if(array1.index(i) == x):
    pos = i
    break
    else:
    continue
    if(pos!=-1):
    print(pos)
    else:
    print(pos)


    I have used while loop to find the element position corresponding with the search element x But the pycharm console doesnt print anything after the input please help

    Continue reading...

Compartilhe esta Página