1) Iterate with enumerate instead or range(len(x))

Text Description automatically generated

2) Use list comprehension instead of raw for loops

Text Description automatically generated

3) Sort complex iterables with sorted()

Text Description automatically generated

4) Save memory with Generators

Text Description automatically generated

5) Define default values in Dictionaries with .get() and .setdefault()

Text Description automatically generated

6) Count hashable objects with collections.Counter

Text Description automatically generated

7) Format strings with f-Strings (Python 3.6+)

A screenshot of a computer Description automatically generated with medium confidence

8) Concatenate strings with .join()

Text Description automatically generated

9) Merge dictionaries with {**d1, **d2} (Python 3.5+)

Text Description automatically generated