summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/last_elem_2/en.py
blob: 93c7c0510b3879cbc22deca980746a28b87c2023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
name = 'last_elem/2'
slug = 'find last element in list'

description = '''\
<p><code>last_elem(L, E)</code>: <code>E</code> is the last element of list <code>L</code>.</p>
<pre>
?- last_elem([1,2,3], X).
  X = 3.
?- last_elem([3,2,X], 1).
  X = 1.
</pre>'''

hint = {}