An open API service indexing awesome lists of open source software.

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:

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

"import this"

Measure the execution time of small bits of Python code with the "timeit" module

"is" VS "=="

Python's shorthand for in-place value swapping

Dicts can be used to emulate switch/case statements

Finding the most common elements in an iterable

Fun

Type annotations