Ask Your Question
0

How to extract the value from a slider bar.

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

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
0

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

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

    a_i=list(var('a_%d' %i)for i in range(0,n+1))
    show(a_i)
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

Stats

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

Seen: 77 times

Last updated: Dec 29 '16