Ask Your Question
0

How to extract the value from a slider bar.

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

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

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

Seen: 230 times

Last updated: Dec 29 '16