Wednesday, February 21, 2024

Find the last element of a lis in prolog

 Find the last element of a list in prolog

my_last(X,[X]).

my_last(X,[_|L]) :- my_last(X,L).


No comments:

Post a Comment