Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'list_operation' topicStudent Support Forum > General > Archives > "list_operation"

Next Comment >Help | Reply To Topic
Author Comment/Response
logo
01/27/11 11:34am

Hi guys,

i want to rotate a list and i get always a syntax error and i can't find it. Hope someone can help me, here the code:

Rotate_list[list_, pos_] :=
for [i = 0, i < pos, i++,
Append[list, First[list]],
Delete[list, 1]
],
Return[list]

Syntax::tsntxi: "Rotate_list[list_,pos_]:=for[i=0,<<3>>,Delete[list,1]],Return[list]" is incomplete; more input is needed.

Syntax::sntxi: Incomplete expression; more input is needed.

nice greets, logo

URL: ,

Subject (listing for 'list_operation')
Author Date Posted
list_operation logo 01/27/11 11:34am
Re: list_operation yehuda ben-s... 01/28/11 09:24am
Re: list_operation logo 01/28/11 11:48am
Re: Re: list_operation yehuda ben-s... 01/29/11 7:07pm
Re: list_operation Patrick 02/24/11 10:01am
Next Comment >Help | Reply To Topic