6.40.12 Prepending an element at the beginning of a list: prepend
The prepend command adds an element to the beginning of a list.
-
prepend takes two arguments:
- prepend(x,L) returns a list containing x as the
first element followed by the elements of L.
Examples.
-
Input:
prepend([3,4,2],1)
Output:
- Input:
prepend([1,2],[3,4])
Output: