freeCodeCamp/guide/portuguese/python/keywords/index.md

22 lines
1.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

---
title: Python Keywords
localeTitle: Palavras-chave Python
---
## Palavras-chave Python
O Python possui uma lista de [palavras-chave](https://docs.python.org/3/reference/lexical_analysis.html#keywords) que não podem ser usadas como identificadores (nomes de variáveis). Tentar usar qualquer uma dessas palavras-chave como variáveis criará um **erro de sintaxe** e seu script Python não será executado:
```
>>> False = "Hello campers!"
File "<stdin>"
SyntaxError: can't assign to keyword
>>> break = "Hello campers!"
File "<stdin>", line 1
break = "Hello campers!"
^
SyntaxError: invalid syntax
```
#### Lista de palavras-chave
Palavra chave | - | - | - | - --- | --- | --- | --- | --- `False` | `class` | `finally` | `is` | `return` `None` | `continue` | `for` | `lambda` | `try` `True` | `def` | `from` | `nonlocal` | `while` `and` | `del` | `global` | `not` | `with` `as` | `elif` | `if` | `or` | `yield` `assert` | `else` | `import` | `pass` `break` | `except` | `in` | `raise`