Skip to content

Instantly share code, notes, and snippets.

@marcoscastro
Created April 28, 2017 03:27
Show Gist options
  • Select an option

  • Save marcoscastro/0d93a68772e2a0bb4944e4f623fb5b25 to your computer and use it in GitHub Desktop.

Select an option

Save marcoscastro/0d93a68772e2a0bb4944e4f623fb5b25 to your computer and use it in GitHub Desktop.
Curso Python 300 - Aula 32 - Else com Loops
lista = [20, 10, 5, 30]
item = 30
'''
for i in lista:
if i == item:
print('Item encontrado')
break
else:
print('O item nao foi encontrado')
'''
i = 0
while i < len(lista):
if lista[i] == item:
print('Item encontrado')
break
i = i + 1
else:
print('O item nao foi encontrado')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment