Official documentation (Python 3)
Q & A
- Is Python strongly typed? Apparently, yes.
- Strings are immutable
- Create a list with a specific size
mylist = [None] * N
- Default value for dictionary
d = d.get(key, default_value)
- Compute frequencies
- collections.Counter(input)
- Iterate over the elements with
f = f.get(key, 0) + 1
- How to access the index value in a ‘for’ loop?
- How to get the ASCII value of a character
- Get the first item from an iterable that matches a condition
- Slicing a list in Python without generating a copy
- bisect_left and bisect_right (lower_bound and upper_bound in C++)
Built-in functions
math
random
statistics
itertools
Input/Output
Date & time
Parsing/Formatting
Other
Functional programming
Data structures
- List
- Dictionary
- Set
- Stack
- Queue
- Priority queue
- Linked list