> ## 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.

# Use Fstring For Concatenation

#### Sourcery refactoring id: `use-fstring-for-concatenation`

#### Description:

Use f-strings for concatenating strings instead of '+'

#### Before:

```python
output = "Name: " + name + ", Age: " + age
```

#### After:

```python
output = f"Name: {name}, Age: {age}"
```

#### Explanation:

Python added f-strings in version 3.6, with
[PEP 498](https://www.python.org/dev/peps/pep-0498/). F-strings are a flexible
and powerful way to concatenate strings. They make the code shorter and more
readable, since the code now looks more like the output.

This refactoring replaces string concatenations using '+' with f-strings. This
will only trigger if the concatenation is a mixture of strings and calculated
values.
