Python

Basis

Data Structures

["apple","banana"] # list, ordered, dynamic array implementation
("apple", "banana") # tuple, immutable list
{"apple", "banana"} # set, not ordered, no duplicates allowed
range(6) # range, integers in range(from, to)
{"name":"apple", "price":10} # dict
map function: map(function, iterable) applies the function on every element of the iterable

lists

dictionaries

sets

stack, queue and priority queue

stacks: just use a list as a stack with append() and pop()
queue: from collections import dequeue it's a bi-directional queue
priority queue: import heapq or from queue import PriorityQueue

NumPy

Some general rules in numpy:
1. in indexing, a comma , means indexing another dimension
2. in slicing, a colon : means one of start:end:step
3. axis=0 means do the operation row-wise and axis=1 means do the operation column-wise

OOP

Everything in python classes are public.
More on Python magic methods, see here
# skeleton code for a python class
class MyClass:
    myProperty = 1

    def __init__(self, propValue): # this is one of the magic methods of Python classes
        self.myProperty = propValue

    def myMethod():
        # do something

    def myMethod2(self): # self refers to this object; doesn't have to be self, but must be the first parameter
        # do something with this object

# inheritance
class MyChildClass(MyClass):
    def inheritedMethod1():
        super().myMethod()
        # do something else here

# how you would use a python class
myObject = MyClass(100)
print(myObject.myProperty)
myObject.myMethod2()

Matplotlib

Pyplot

You can't really plot a function directly. To plot a function, you have to use numpy to create a list of points and then plot these points.
x = np.arange(0,1) 
y =  np.log(math.comb(100, 40)) # put your function here
plt.title("Matplotlib demo") 
plt.xlabel("x axis caption") 
plt.ylabel("y axis caption") 
plt.plot(x,y) 
plt.show()