Remove an index from a list

Hello, I would like to remove an index from a list.
For example, I have this list:
blocks (2)

I remove index 4 to have this:
blocks (3)

Is it possible to do that?

1 Like

thank you :slight_smile:

HI. If I may try to explain it. In your image 1, the index 4 of your list called "List" holds the data "4".
By removing the "4" you are simply removing the data in index 4.
In your second image the index number 4 of your "List" holds the data "5".
We cannot actually remove the index in a list, but the data or value which is stored can be manipulated.

Yeah, I say it like that because I was thinking that use the block "remove list item" at index 4 would do something like replace the data 4 by "null" or "empty".
I just misunderstood that.

You were thinking of arrays, while AI2 lists are linked lists, that collapse after item removal.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.