Ask Your Question
0

Create a periodic vector/array

asked 2015-11-11 18:51:31 +0200

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 19:13:31 +0200

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 19:23:12 +0200 )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-12 06:03:56 +0200 )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 18:51:31 +0200

Seen: 410 times

Last updated: Nov 11 '15