for example i have a list A [1, 2, 3, 4, 5, 6 ]
right shift list A by 2 => A [5, 6, 1, 2, 3, 4]
left shift list A by 2 => A [3, 4, 5, 6, 1, 2]
for example i have a list A [1, 2, 3, 4, 5, 6 ]
right shift list A by 2 => A [5, 6, 1, 2, 3, 4]
left shift list A by 2 => A [3, 4, 5, 6, 1, 2]
What you're asking for is called "rotate," not "shift." A right shift would give you something like [0,0,1,2,3,4]. But yes, just construct a list of the item numbers you want, then use ITEM.
Could I suggest that you read the description of ITEM in the Reference Manual before you ask a zillion questions?
which page?
btw yes, i want exactly right shift so that it would be [0, 0, 1, 2, 3, 4], but how do i "construct" it? dont get me wrong, but isnt manual kind of high level and doesnt cover all hidden things?
It does cover a lot of hidden things, in fact, it probably contains more hidden things than you can find on your own.
is there an info about shifting lists?
Well, I'm not sure, but if you look at the pattern, you should be able to figure it out.
i already made my own version of shifting lists without looking at manual, the reason why i ask is that because i cant be sure if there is anything like that already existing in libraries
At the back of the manual is this thing called an "index."
yeah i wont find the exact page covering it
Look, I don't have the page numbers of everything in the manual memorized. So either I look at all the index entries or you do. You'll learn more if it's you. (Plus I don't have to do so much work for you.)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.