Created
April 28, 2017 03:27
-
-
Save marcoscastro/0d93a68772e2a0bb4944e4f623fb5b25 to your computer and use it in GitHub Desktop.
Curso Python 300 - Aula 32 - Else com Loops
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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