"""
CSCI 145 Day 3 - stack diagrams (solution)

Frames, in the order they are pushed:
    global:   x = 4
    mystery:  x = 4, then y = 13
    triple:   x = 4, then x = 12 (returns 12, popped)
mystery returns 13 and is popped; global result = 13
"""

def triple(x):
    x = x * 3
    return x

def mystery(x):
    y = triple(x) + 1
    return y

x = 4
result = mystery(x)
print(result)       # 13
