# ramki - zasięg zmiennych, można prześledzić w wizualizatorze
# https://www.pythontutor.com/visualize.html
# przykład na enclosing frame ("E" w "LEBG")

def compose(f, g):
    def fg(x):
        return f(g(x))
    return fg


def square(x):
    return x ** 2


def double(x):
    return 2 * x


h = compose(square, double)
print(h(10)) # square(double(10)), czyli 400
