labex-labs/python-cheatsheet
labex-labs/python-cheatsheet has 4,967 GitHub stars and 1,331 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-07 14:53 UTC. Last push 2026-10-22.
A comprehensive Python cheat sheet with code examples, built-in functions, module references, and hands-on labs by LabEx.
What you can do
- Comprehensive Coverage: From basics to advanced topics including built-in functions, control flow, data structures, and more
- Built-in Functions Reference: Detailed documentation for all Python built-in functions
- Module Documentation: Guides for popular Python modules like datetime, json, pathlib, itertools, and more
- Blog Articles: In-depth articles about Python and its ecosystem
Measured star growth
- in 24h
- +1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
Python Cheatsheet

Python Cheatsheet is a comprehensive reference guide for Python developers of all skill levels. Based on the book Automate the Boring Stuff with Python and many other sources, this cheatsheet provides a quick reference for common Python tasks and concepts.
Anyone can forget how to make character classes for a regex, slice a list, or do a for loop. This Python cheatsheet tries to provide basic reference for beginner and advanced developers, lower the entry barrier for newcomers and help veterans refresh the old tricks.
Features
- Comprehensive Coverage: From basics to advanced topics including built-in functions, control flow, data structures, and more
- Built-in Functions Reference: Detailed documentation for all Python built-in functions
- Module Documentation: Guides for popular Python modules like
datetime,json,pathlib,itertools, and more - Blog Articles: In-depth articles about Python and its ecosystem
- Easy Navigation: Well-organized sections with clear examples and explanations
- Dark Mode Support: Beautiful UI with light and dark themes
Hands-on Labs on LabEx
Practice the concepts in this cheat sheet with interactive labs in your browser. Follow the Python Cheatsheet course on LabEx, or choose a lab below. Each topic links to its reference page on the Python Cheat Sheet website; the VS Code lab helps you get started with your development environment.
| Topic | Cheat Sheet Reference | Practice |
|---|---|---|
| Use VS Code for Python Development | — | Start Lab |
| Python Basics | Read reference | Start Lab |
| Python Built-in Functions | Read reference | Start Lab |
| Python Control Flow | Read reference | Start Lab |
| Python Functions | Read reference | Start Lab |
| Python Lists and Tuples | Read reference | Start Lab |
| Python Dictionaries | Read reference | Start Lab |
| Python Sets | Read reference | Start Lab |
| Python Comprehensions | Read reference | Start Lab |
| Python String Manipulation | Read reference | Start Lab |
| Python String Formatting | Read reference | Start Lab |
| Python Regular Expressions | Read reference | Start Lab |
| Python File and Directory Path Manipulation | Read reference | Start Lab |
| Python Reading and Writing Files | Read reference | Start Lab |
| Python JSON and YAML | Read reference | Start Lab |
| Python Exception Handling | Read reference | Start Lab |
| Python Debugging | Read reference | Start Lab |
| Python Args and Kwargs | Read reference | Start Lab |
| Python Decorators | Read reference | Start Lab |
| Python Context Manager | Read reference | Start Lab |
| Python OOP Basics | Read reference | Start Lab |
| Python Dataclasses | Read reference | Start Lab |
| Python Packaging | Read reference | Start Lab |
| Python Main Function | Read reference | Start Lab |
| Python Virtual Environments | Read reference | Start Lab |
Quick Links
- View on GitHub: Drop a star on GitHub if you find this project useful
- Contribute: Get to know how easy it is to contribute to the Python Cheatsheet
- Blog: Read detailed articles about Python and its ecosystem
- Changelog: See what is new, what got fixed, and what is coming
Contributing
Contributions are welcome! Please see the Contributing Guide for details on how to get started.
License
Content is licensed under MIT and maintained by the LabEx team.
More Cheatsheets
- Ansible Cheatsheet
- C Programming Cheatsheet
- Comptia Cheatsheet
- C++ Cheatsheet
- CSS Cheatsheet
- Cybersecurity Cheatsheet
- Database Cheatsheet
- Data Science Cheatsheet
- DevOps Cheatsheet
- Docker Cheatsheet
- Git Cheatsheet
- Go Cheatsheet
- HTML Cheatsheet
- Hydra Cheatsheet
- Java Cheatsheet
- JavaScript Cheatsheet
- Jenkins Cheatsheet
- Kali Cheatsheet
- Kubernetes Cheatsheet
- Linux Cheatsheet
- Matplotlib Cheatsheet
- MongoDB Cheatsheet
- MySQL Cheatsheet
- Nmap Cheatsheet
- NumPy Cheatsheet
- Pandas Cheatsheet
- PostgreSQL Cheatsheet
- Python Cheatsheet
- React Cheatsheet
- Redis Cheatsheet
- RHEL Cheatsheet
- Shell Cheatsheet
- Scikit-learn Cheatsheet
- SQLite Cheatsheet
- Web Development Cheatsheet
- Wireshark Cheatsheet
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,909 starspublic-apis/public-apis
A collective list of free APIs
497,153 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
442,238 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,174 stars