From 21dcea9bd2987aebe6264821d65b63b652e67031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Tue, 26 Mar 2019 02:48:47 +0100 Subject: [PATCH] Main, format --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 01bee8a..fc4f2c9 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Comprehensive Python Cheatsheet Main ---- ```python -if __name__ == '__main__': +if __name__ == '__main__': # Runs main() if file wasn't imported. main() ``` @@ -314,7 +314,8 @@ Format ``` ```python ->>> Person = collections.namedtuple('Person', 'name height') +>>> from collections import namedtuple +>>> Person = namedtuple('Person', 'name height') >>> person = Person('Jean-Luc', 187) >>> f'{person.height}' '187' @@ -357,6 +358,7 @@ Format {-123456: } # '-123456' ``` +#### Char, Hex, Binary: ```python {90:c} # 'Z' {90:X} # '5A'