5.3.10 Appending an element at the end of a list
The
append
command adds an element to the end of a list.
append
takes two arguments:
L
, a list.
x
, an object.
append(
L
,
x
)
returns a list
L
with the additional element
x
at the end.
Examples
append
([3,4,2],1)
⎡
⎣
3,4,2,1
⎤
⎦
append
([1,2],[3,4])
⎡
⎣
1,2,
⎡
⎣
3,4
⎤
⎦
⎤
⎦