Skip to main content
Tweeted twitter.com/StackMma/status/1045372529634889728
added 14 characters in body
Source Link

Say a list is given as

list=list = {a, b, c, d, r, m, n};

Suppose I want to insert 2 and 3 at position 3 and 7, respectively.

Insert[list, 2, 3] puts 2 at position 3, but Insert[list, {{2, 3}, {3, 7}}] does nothing.

How is it possible?

Say a list is given as

list={a,b,c,d,r,m,n};

Suppose I want to insert 2 and 3 at position 3 and 7, respectively.

Insert[list,2,3] puts 2 at position 3, but Insert[list,{{2,3},{3,7}}] does nothing.

How is it possible?

Say a list is given as

list = {a, b, c, d, r, m, n};

Suppose I want to insert 2 and 3 at position 3 and 7, respectively.

Insert[list, 2, 3] puts 2 at position 3, but Insert[list, {{2, 3}, {3, 7}}] does nothing.

How is it possible?

Source Link

How to insert elements at different locations of a given list

Say a list is given as

list={a,b,c,d,r,m,n};

Suppose I want to insert 2 and 3 at position 3 and 7, respectively.

Insert[list,2,3] puts 2 at position 3, but Insert[list,{{2,3},{3,7}}] does nothing.

How is it possible?