Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vetor = []
- for i in range(1, 5):
- vnum = int(input('Digite um valor: '))
- vetor.append(vnum)
- num = int(input("Digite o valor a ser pesquisado: "))
- i = 0
- achei = False
- while i <= 4 and achei == False:
- if num == vetor[i]:
- achei = True
- else:
- i = i + 1
- if achei == True:
- print(f'O numero {num} esta na posição {vetor[i]}')
- else:
- print(f'O numero {num} não se encontra na lista.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement