Skip to content

Commit

Permalink
Update Exercício 074.py
Browse files Browse the repository at this point in the history
Added the code and a note about code function
  • Loading branch information
mateusadada committed May 17, 2023
1 parent 71c433a commit 42c34cd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Exercícios resolvidos/Exercício 074.py
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# Exemplo de pesquisa em uma lista

def procurar(number):
for i, e in enumerate(lista):
if e == number:
return f'\nFoi encontrado o número {e} na posição {i + 1}'
else:
return f'\nNão foi encontrado o número {number} na lista'


lista = list(range(1, 200, 17))

print('Bem vindo ao programa que procura um número em uma lista!'
f'\nLista: {lista}')
numero = int(input('Digite um número: '))

print(procurar(numero))

0 comments on commit 42c34cd

Please sign in to comment.