Ask Your Question

How to extract the value from a slider bar.

asked 2016-12-29 08:56:16 -0500

sage: @interact

sage: def func(n = slider(0, 10, 1)):

sage: print("n: %s" %n)

This gives me a slider bar with corresponding value of n, how do I link this value of n directly to a list such as:

sage: n=7

sage: a_i=list(var('a_%d' %i)for i in range(0,n+1))

sage: show(a_i)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2016-12-29 14:55:26 -0500

def func(n = slider(0, 10, 1)):

    a_i=list(var('a_%d' %i)for i in range(0,n+1))
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-12-29 08:33:23 -0500

Seen: 76 times

Last updated: Dec 29 '16