Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can try with global variables, something like:

Cell 1

a = 3

Cell 2

@interact(n=a)
def square(n):
    global a1
    print("{} squared is {}".format(n, n*n))
    a1 = n

Cell 3

a1