Solution
%% The head of the list is 0. So, the list obviously contains 0. contains_0([0|_]). %% The head of the list is not 0. Check whether the tail of the list, %% contains 0. contains_0([Head|Tail]) :- Head \= 0, contains_0(Tail).
Solution
%% The head of the list is 0. So, the list obviously contains 0. contains_0([0|_]). %% The head of the list is not 0. Check whether the tail of the list, %% contains 0. contains_0([Head|Tail]) :- Head \= 0, contains_0(Tail). |