# E se não?

Nos exemplos anteriores, o código foi executado somente quando as condições eram verdade. Mas o Python também tem instruções `elif` e `else`:

```
if 5 > 2:
    print('5 é realmente maior que 2')
else:
    print('5 não é maior que 2')
```

Quando for executado irá imprimir:

```
$ python3 python_intro.py
5 é realmente maior que 2
```

Se 2 for um número maior do que 5, então o segundo comando será executado. Fácil, né? Vamos ver como funciona o `elif`:

```
nome = 'Sonja'
if nome == 'Ola':
    print('Oi Ola!')
elif nome == 'Sonja':
    print('Oi Sonja!')
else:
    print('Oi anônimo!')
```

e executado:

```
$ python3 python_intro.py
Oi Sonja!
```

Viu o que aconteceu? O python comparou o valor da variável `nome` e caiu na condição do `elif` onde compara `nome == 'Sonja'` e assim imprimiu `Oi Sonja!` :D


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dgportoalegre.gitbook.io/djangogirls/introducao-ao-python/salve-o-codigo/e-se-nao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
