Ask Your Question

How to extract the value from a slider bar.

asked 2016-12-29 15:56:16 +0200

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 21:55:26 +0200

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 15:33:23 +0200

Seen: 218 times

Last updated: Dec 29 '16