Browse Source

Format

pull/3/head
Jure Šorn 6 years ago
parent
commit
31cb8f23ef
1 changed files with 4 additions and 3 deletions
  1. 7
      README.md

7
README.md

@ -278,10 +278,11 @@ Format
```
```python
>>> person = {'name': 'Jean-Luc', 'height': 187}
>>> f"{person['height']}"
>>> Person = namedtuple('Person', 'name height')
>>> person = Person('Jean-Luc', 187)
>>> f'{person.height}'
'187'
>>> '{p[height]}'.format(p=person)
>>> '{p.height}'.format(p=person)
'187'
```

Loading…
Cancel
Save