Ask Your Question
0

Create a periodic vector/array

asked 2015-11-11 11:51:31 -0600

Erel Segal-Halevi gravatar image

What is the quickest way to create an array of length 999 such as the following:

[0, 2, 7, 0, 2, 7, 0, 2, 7, ...]

?

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2015-11-11 12:13:31 -0600

FrédéricC gravatar image

[0,2,7]*333

edit flag offensive delete link more

Comments

So simple! Thanks.

Erel Segal-Halevi gravatar imageErel Segal-Halevi ( 2015-11-11 12:23:12 -0600 )edit

Yup! Learning a bit of Python will go a long way with Sage; there are a number of great tutorials out there.

kcrisman gravatar imagekcrisman ( 2015-11-11 23:03:56 -0600 )edit

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: 2015-11-11 11:51:31 -0600

Seen: 44 times

Last updated: Nov 11 '15