| route-pattern | /:user_id/:repository |
| route-controller | files |
| route-action | disambiguate |
| fetch-nonce | v2:48ad30dd-bfd0-f1e0-6471-46cba7da7240 |
| current-catalog-service-hash | f3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb |
| request-id | C5E6:55AD2:C9984:11ECD4:6968E95A |
| html-safe-nonce | d3e921d29bebbebe27e48e1bd81a0b73b5322965095677cfe31c566453e43b6d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNUU2OjU1QUQyOkM5OTg0OjExRUNENDo2OTY4RTk1QSIsInZpc2l0b3JfaWQiOiI5MDMwMjg2MTgxOTMwNzA0MjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f34a7093eabee3a1a28d2dbc5efd2c7d2b2f4e55da05b74425986a042c1e818f |
| hovercard-subject-tag | repository:106742300 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | // |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/mdaffern/python-cheat-sheet |
| twitter:image | https://opengraph.githubassets.com/a53cca1f8bb0fde0f534be0dec1dfef55108f007b031ba58eeb0da4423bebac9/mdaffern/python-cheat-sheet |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a53cca1f8bb0fde0f534be0dec1dfef55108f007b031ba58eeb0da4423bebac9/mdaffern/python-cheat-sheet |
| og:image:alt | From Raymond Hettinger's Transforming Code into Beautiful, Idiomatic Python - mdaffern/python-cheat-sheet |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b5416305695900bdab7d289f90ea3d96bf36397112f2ab16f5a5a120f38de085 |
| turbo-cache-control | no-preview |
| go-import | github.com/mdaffern/python-cheat-sheet git https://github.com/mdaffern/python-cheat-sheet.git |
| octolytics-dimension-user_id | 3236055 |
| octolytics-dimension-user_login | mdaffern |
| octolytics-dimension-repository_id | 106742300 |
| octolytics-dimension-repository_nwo | mdaffern/python-cheat-sheet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 71482259 |
| octolytics-dimension-repository_parent_nwo | abrenaut/python-cheat-sheet |
| octolytics-dimension-repository_network_root_id | 71482259 |
| octolytics-dimension-repository_network_root_nwo | abrenaut/python-cheat-sheet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 366035abf3d5b1e31841c97e2fa2ce02a3007a7b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| Skip to content | https://github.com/mdaffern/python-cheat-sheet#start-of-content |
|
| https://github.com/ |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmdaffern%2Fpython-cheat-sheet |
| GitHub CopilotWrite better code with AI | https://github.com/features/copilot |
| GitHub SparkBuild and deploy intelligent apps | https://github.com/features/spark |
| GitHub ModelsManage and compare prompts | https://github.com/features/models |
| MCP RegistryNewIntegrate external tools | https://github.com/mcp |
| ActionsAutomate any workflow | https://github.com/features/actions |
| CodespacesInstant dev environments | https://github.com/features/codespaces |
| IssuesPlan and track work | https://github.com/features/issues |
| Code ReviewManage code changes | https://github.com/features/code-review |
| GitHub Advanced SecurityFind and fix vulnerabilities | https://github.com/security/advanced-security |
| Code securitySecure your code as you build | https://github.com/security/advanced-security/code-security |
| Secret protectionStop leaks before they start | https://github.com/security/advanced-security/secret-protection |
| Why GitHub | https://github.com/why-github |
| Documentation | https://docs.github.com |
| Blog | https://github.blog |
| Changelog | https://github.blog/changelog |
| Marketplace | https://github.com/marketplace |
| View all features | https://github.com/features |
| Enterprises | https://github.com/enterprise |
| Small and medium teams | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| App Modernization | https://github.com/solutions/use-case/app-modernization |
| DevSecOps | https://github.com/solutions/use-case/devsecops |
| DevOps | https://github.com/solutions/use-case/devops |
| CI/CD | https://github.com/solutions/use-case/ci-cd |
| View all use cases | https://github.com/solutions/use-case |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| View all industries | https://github.com/solutions/industry |
| View all solutions | https://github.com/solutions |
| AI | https://github.com/resources/articles?topic=ai |
| Software Development | https://github.com/resources/articles?topic=software-development |
| DevOps | https://github.com/resources/articles?topic=devops |
| Security | https://github.com/resources/articles?topic=security |
| View all topics | https://github.com/resources/articles |
| Customer stories | https://github.com/customer-stories |
| Events & webinars | https://github.com/resources/events |
| Ebooks & reports | https://github.com/resources/whitepapers |
| Business insights | https://github.com/solutions/executive-insights |
| GitHub Skills | https://skills.github.com |
| Documentation | https://docs.github.com |
| Customer support | https://support.github.com |
| Community forum | https://github.com/orgs/community/discussions |
| Trust center | https://github.com/trust-center |
| Partners | https://github.com/partners |
| GitHub SponsorsFund open source developers | https://github.com/sponsors |
| Security Lab | https://securitylab.github.com |
| Maintainer Community | https://maintainers.github.com |
| Accelerator | https://github.com/accelerator |
| Archive Program | https://archiveprogram.github.com |
| Topics | https://github.com/topics |
| Trending | https://github.com/trending |
| Collections | https://github.com/collections |
| Enterprise platformAI-powered developer platform | https://github.com/enterprise |
| GitHub Advanced SecurityEnterprise-grade security features | https://github.com/security/advanced-security |
| Copilot for BusinessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/premium-support |
| Pricing | https://github.com/pricing |
| Search syntax tips | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
| documentation | https://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax |
|
Sign in
| https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmdaffern%2Fpython-cheat-sheet |
|
Sign up
| https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=mdaffern%2Fpython-cheat-sheet |
| Reload | https://github.com/mdaffern/python-cheat-sheet |
| Reload | https://github.com/mdaffern/python-cheat-sheet |
| Reload | https://github.com/mdaffern/python-cheat-sheet |
|
mdaffern
| https://github.com/mdaffern |
| python-cheat-sheet | https://github.com/mdaffern/python-cheat-sheet |
| abrenaut/python-cheat-sheet | https://github.com/abrenaut/python-cheat-sheet |
|
Notifications
| https://github.com/login?return_to=%2Fmdaffern%2Fpython-cheat-sheet |
|
Fork
0
| https://github.com/login?return_to=%2Fmdaffern%2Fpython-cheat-sheet |
|
Star
1
| https://github.com/login?return_to=%2Fmdaffern%2Fpython-cheat-sheet |
|
1
star
| https://github.com/mdaffern/python-cheat-sheet/stargazers |
|
14
forks
| https://github.com/mdaffern/python-cheat-sheet/forks |
|
Branches
| https://github.com/mdaffern/python-cheat-sheet/branches |
|
Tags
| https://github.com/mdaffern/python-cheat-sheet/tags |
|
Activity
| https://github.com/mdaffern/python-cheat-sheet/activity |
|
Star
| https://github.com/login?return_to=%2Fmdaffern%2Fpython-cheat-sheet |
|
Notifications
| https://github.com/login?return_to=%2Fmdaffern%2Fpython-cheat-sheet |
|
Code
| https://github.com/mdaffern/python-cheat-sheet |
|
Pull requests
0
| https://github.com/mdaffern/python-cheat-sheet/pulls |
|
Actions
| https://github.com/mdaffern/python-cheat-sheet/actions |
|
Projects
0
| https://github.com/mdaffern/python-cheat-sheet/projects |
|
Wiki
| https://github.com/mdaffern/python-cheat-sheet/wiki |
|
Security
Uh oh!
There was an error while loading. Please reload this page.
| https://github.com/mdaffern/python-cheat-sheet/security |
| Please reload this page | https://github.com/mdaffern/python-cheat-sheet |
|
Insights
| https://github.com/mdaffern/python-cheat-sheet/pulse |
|
Code
| https://github.com/mdaffern/python-cheat-sheet |
|
Pull requests
| https://github.com/mdaffern/python-cheat-sheet/pulls |
|
Actions
| https://github.com/mdaffern/python-cheat-sheet/actions |
|
Projects
| https://github.com/mdaffern/python-cheat-sheet/projects |
|
Wiki
| https://github.com/mdaffern/python-cheat-sheet/wiki |
|
Security
| https://github.com/mdaffern/python-cheat-sheet/security |
|
Insights
| https://github.com/mdaffern/python-cheat-sheet/pulse |
| Branches | https://github.com/mdaffern/python-cheat-sheet/branches |
| Tags | https://github.com/mdaffern/python-cheat-sheet/tags |
| https://github.com/mdaffern/python-cheat-sheet/branches |
| https://github.com/mdaffern/python-cheat-sheet/tags |
| 2 Commits | https://github.com/mdaffern/python-cheat-sheet/commits/master/ |
| https://github.com/mdaffern/python-cheat-sheet/commits/master/ |
| readme.md | https://github.com/mdaffern/python-cheat-sheet/blob/master/readme.md |
| readme.md | https://github.com/mdaffern/python-cheat-sheet/blob/master/readme.md |
| README | https://github.com/mdaffern/python-cheat-sheet |
| https://github.com/mdaffern/python-cheat-sheet#the-python-way |
| Transforming Code into Beautiful, Idiomatic Python | https://www.youtube.com/watch?v=OSGv2VnC0go |
| https://github.com/mdaffern/python-cheat-sheet#loops |
| https://github.com/mdaffern/python-cheat-sheet#looping-over-a-range-of-numbers |
| range(start, stop[, step]) | https://docs.python.org/3/library/stdtypes.html#typesseq-range |
| https://github.com/mdaffern/python-cheat-sheet#looping-over-a-collection |
| https://github.com/mdaffern/python-cheat-sheet#looping-backwards |
| reversed(seq) | https://docs.python.org/3/library/functions.html#reversed |
| https://github.com/mdaffern/python-cheat-sheet#looping-over-a-collection-and-indices |
| enumerate(iterable, start=0) | https://docs.python.org/3/library/functions.html#enumerate |
| https://github.com/mdaffern/python-cheat-sheet#looping-over-two-collections |
| zip(*iterables) | https://docs.python.org/3.3/library/functions.html#zip |
| https://github.com/mdaffern/python-cheat-sheet#nested-loops |
| itertools.product(*iterables, repeat=1) | https://docs.python.org/3/library/itertools.html#itertools.product |
| https://github.com/mdaffern/python-cheat-sheet#looping-in-sorted-order |
| sorted(iterable[, key][, reverse]) | https://docs.python.org/3/library/functions.html#sorted |
| https://github.com/mdaffern/python-cheat-sheet#call-a-function-until-a-sentinel-value |
| iter(object[, sentinel]) | https://docs.python.org/3/library/functions.html#iter |
| functools.partial(func, *args, **keywords) | https://docs.python.org/3/library/functools.html#functools.partial |
| https://github.com/mdaffern/python-cheat-sheet#distinguishing-multiple-exit-points-in-loops |
| https://github.com/mdaffern/python-cheat-sheet#dictionaries |
| https://github.com/mdaffern/python-cheat-sheet#looping-over-dictionary-keys |
| https://github.com/mdaffern/python-cheat-sheet#looping-over-a-dictionary-keys-and-values |
| https://github.com/mdaffern/python-cheat-sheet#construct-a-dictionary-from-pairs |
| https://github.com/mdaffern/python-cheat-sheet#counting-with-dictionaries |
| class collections.defaultdict([default_factory[, ...]]) | https://docs.python.org/3.3/library/collections.html#collections.defaultdict |
| https://github.com/mdaffern/python-cheat-sheet#grouping-with-dictionaries |
| https://github.com/mdaffern/python-cheat-sheet#remove-and-return-a-key-value-pair-from-a-dictionary |
| popitem() | https://docs.python.org/3.0/library/stdtypes.html#dict.popitem |
| https://github.com/mdaffern/python-cheat-sheet#linking-dictionaries |
| ChainMap | https://docs.python.org/3/library/collections.html#collections.ChainMap |
| https://github.com/mdaffern/python-cheat-sheet#clarity |
| https://github.com/mdaffern/python-cheat-sheet#keyword-arguments |
| https://github.com/mdaffern/python-cheat-sheet#named-tuples |
| https://github.com/mdaffern/python-cheat-sheet#unpacking-sequences |
| https://github.com/mdaffern/python-cheat-sheet#updating-multiple-state-variables |
| https://github.com/mdaffern/python-cheat-sheet#efficiency |
| https://github.com/mdaffern/python-cheat-sheet#concatening-strings |
| https://github.com/mdaffern/python-cheat-sheet#updating-sequences |
| https://github.com/mdaffern/python-cheat-sheet#decorators-and-context-managers |
| @functools.lru_cache(maxsize=128, typed=False) | https://docs.python.org/dev/library/functools.html#functools.lru_cache |
| https://github.com/mdaffern/python-cheat-sheet#factor-out-temporary-contexts |
| https://github.com/mdaffern/python-cheat-sheet#concise-expressive-one-liners |
| https://github.com/mdaffern/python-cheat-sheet#built-ins |
| https://github.com/mdaffern/python-cheat-sheet#replace-multiple-or-statements |
| any(iterable) | https://docs.python.org/3/library/functions.html#any |
|
Readme
| https://github.com/mdaffern/python-cheat-sheet#readme-ov-file |
| Please reload this page | https://github.com/mdaffern/python-cheat-sheet |
|
Activity | https://github.com/mdaffern/python-cheat-sheet/activity |
|
1
star | https://github.com/mdaffern/python-cheat-sheet/stargazers |
|
0
watching | https://github.com/mdaffern/python-cheat-sheet/watchers |
|
0
forks | https://github.com/mdaffern/python-cheat-sheet/forks |
|
Report repository
| https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fmdaffern%2Fpython-cheat-sheet&report=mdaffern+%28user%29 |
| Releases | https://github.com/mdaffern/python-cheat-sheet/releases |
| Packages
0 | https://github.com/users/mdaffern/packages?repo_name=python-cheat-sheet |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |