> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sourcery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Merge Else If Into Elif

#### Sourcery refactoring id: `merge-else-if-into-elif`

#### Description:

Merge else clause's nested if statement into elif

#### Before:

```python
def interpret_response(response):
    if response.status == "200":
        return response.data
    else:
        if response.status == "404":
            return "Not Found"
        else:
            return "Error"
```

#### After:

```python
def interpret_response(response):
    if response.status == "200":
        return response.data
    elif response.status == "404":
        return "Not Found"
    else:
        return "Error"
```

#### Explanation:

Flattening if statements nested within else clauses generates code that is
easier to read and expand upon.
