%% 3. Write a predicate final(X,List) which checks whether X is the last element
%% of List.
final(X, List) :- append(, [X], List). should be final(X, List) :- append(, [_|X], List). to only check the last element of the list instead of the entire list being [X].
%% 3. Write a predicate final(X,List) which checks whether X is the last element %% of List.
final(X, List) :- append(, [X], List). should be final(X, List) :- append(, [_|X], List). to only check the last element of the list instead of the entire list being [X].