O que aprendemos com while também funciona no for (continue, break, else, etc)

This commit is contained in:
Luiz Otávio
2022-10-28 12:18:13 -03:00
parent 16b37e5511
commit 75f3f24a65
2 changed files with 19 additions and 6 deletions

12
.vscode/settings.json vendored
View File

@@ -18,12 +18,12 @@
"editor.defaultFormatter": "ms-python.python",
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.fixAll.unusedImports": false,
"source.organizeImports": true
}
"editor.formatOnSave": true
// "editor.codeActionsOnSave": {
// "source.fixAll": true,
// "source.fixAll.unusedImports": false,
// "source.organizeImports": true
// }
},
"python.languageServer": "Pylance",
"python.formatting.autopep8Args": [

13
aula46.py Normal file
View File

@@ -0,0 +1,13 @@
for i in range(10):
if i == 2:
print('i é 2, pulando...')
continue
if i == 8:
print('i é 8, seu else não executará')
break
for j in range(1, 3):
print(i, j)
else:
print('For completo com sucesso!')