Skip to content

Commit 31cb8f2

Browse files
committed
Format
1 parent 3c16e7c commit 31cb8f2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,11 @@ Format
278278
```
279279

280280
```python
281-
>>> person = {'name': 'Jean-Luc', 'height': 187}
282-
>>> f"{person['height']}"
281+
>>> Person = namedtuple('Person', 'name height')
282+
>>> person = Person('Jean-Luc', 187)
283+
>>> f'{person.height}'
283284
'187'
284-
>>> '{p[height]}'.format(p=person)
285+
>>> '{p.height}'.format(p=person)
285286
'187'
286287
```
287288

0 commit comments

Comments
 (0)