Categories
Mastering Development

Combining two lists in prolog

How would you combine two lists? This is what I tried but it doesn’t give me the result I want, Y = [1,2,3]. Z = [3,4,5]. X = [Y,Z]. This just gives a bigger list with a divided Head and Tail. I want my output to look like this: X = [1,2,3,4,5].