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

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

#### Description

Replace calls to `string.format()` with f-strings.

#### Before

```python
print("Good {}, {} {}".format(time_of_day, first_name, last_name))
```

#### After

```python
print(f"Good {time_of_day}, {first_name} {last_name}")
```

#### 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 format strings. They make the code shorter and more
readable, since the code now looks more like the output.
