diff --git a/README.md b/README.md index 3f1edef..7de3a6f 100644 --- a/README.md +++ b/README.md @@ -273,11 +273,18 @@ import re Format ------ ```python -# Both return ', ': = '{}, {}'.format(, ) = f'{}, {}' ``` +```python +>>> person = {'name': 'Jean-Luc', 'height': 187.1} +>>> '{p[height]:.0f}'.format(p=person) +'187' +>>> f"{person['height']:.0f}" +'187' +``` + ### General Options ```python {:<10} # ' ' @@ -312,15 +319,6 @@ Format * `'x'` - Hex * `'X'` - HEX -### Example -```python ->>> person = {'name': 'Jean-Luc', 'height': 187.1} ->>> '{p[height]:.0f}'.format(p=person) -'187' ->>> f"{person['height']:.0f}" -'187' -``` - Numbers -------