https://github.com/hubertroy/pythontricks
Python tricks. Take your Python skills to the next level. :snake: :cake:
https://github.com/hubertroy/pythontricks
python python-trick skill tricks
Last synced: 3 months ago
JSON representation
Python tricks. Take your Python skills to the next level. :snake: :cake:
- Host: GitHub
- URL: https://github.com/hubertroy/pythontricks
- Owner: HuberTRoy
- Created: 2017-11-02T13:19:01.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-27T08:33:24.000Z (almost 8 years ago)
- Last Synced: 2025-06-05T02:05:10.938Z (4 months ago)
- Topics: python, python-trick, skill, tricks
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🐍 Take your Python skills to the next level 🐍
These tricks come from Dan Bader and myself.
Title:
Merging two dicts in Python 3.5+ with a single expression.
Different ways to test multiple flags at once in Python
How to sort a Python dict by value
The get() method on Python dicts and its 'default' arg
Python's namedtuples can be a great alternative to defining a class manually
You can use "json.dumps()" to pretty-print Python dicts
Function argument unpacking in Python
Measure the execution time of small bits of Python code with the "timeit" module
Python's shorthand for in-place value swapping
Dicts can be used to emulate switch/case statements