We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f10f28a commit 21dcea9Copy full SHA for 21dcea9
README.md
@@ -9,7 +9,7 @@ Comprehensive Python Cheatsheet
9
Main
10
----
11
```python
12
-if __name__ == '__main__':
+if __name__ == '__main__': # Runs main() if file wasn't imported.
13
main()
14
```
15
@@ -314,7 +314,8 @@ Format
314
315
316
317
->>> Person = collections.namedtuple('Person', 'name height')
+>>> from collections import namedtuple
318
+>>> Person = namedtuple('Person', 'name height')
319
>>> person = Person('Jean-Luc', 187)
320
>>> f'{person.height}'
321
'187'
@@ -357,6 +358,7 @@ Format
357
358
{-123456: } # '-123456'
359
360
361
+#### Char, Hex, Binary:
362
363
{90:c} # 'Z'
364
{90:X} # '5A'
0 commit comments