- #1
Sarah rob
- 16
- 0
If I have a list say
li = {18, 22, 4, 10}
and I want to add for example 7 to this list
Join[li, {7}] to get {18, 22, 4, 10, 7},
can I insert the 7 after the 4, to get {18, 22, 4, 7, 10},
I can't just use Sort[ {18, 22, 5, 10, 7}] as I don' t want to change the order of the whole list?
li = {18, 22, 4, 10}
and I want to add for example 7 to this list
Join[li, {7}] to get {18, 22, 4, 10, 7},
can I insert the 7 after the 4, to get {18, 22, 4, 7, 10},
I can't just use Sort[ {18, 22, 5, 10, 7}] as I don' t want to change the order of the whole list?