Ask Your Question

Create a new list

asked 2013-12-19 07:52:39 -0500

anonymous user


updated 2015-01-14 07:08:27 -0500

FrédéricC gravatar image

Hi! I have a work to do on Sage and I want to know how can I create a new list where I can put 50k values, so then I can show it after on a graphic. Also I have another question, how can i generate randomly a number between one and three? Thank you!

edit retag flag offensive close merge delete


I think that we need a little more specifics on your first question - can you give us a toy example? Creating a list is normally as easy as `L = [1,2,3]`.

kcrisman gravatar imagekcrisman ( 2013-12-19 08:39:09 -0500 )edit

1 answer

Sort by » oldest newest most voted

answered 2013-12-19 08:39:18 -0500

kcrisman gravatar image

Second question: Depending on what you want, one of these should work.

sage: random()*2+1
sage: randint(1,3)
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


Asked: 2013-12-19 07:52:39 -0500

Seen: 1,725 times

Last updated: Dec 19 '13