From 31cb8f23ef051076cac10de3758f66df7005fda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 25 Dec 2018 19:24:00 +0100 Subject: [PATCH] Format --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5b453ca..3bdb614 100644 --- a/README.md +++ b/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' ```