summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/sum_2/common.py
blob: 106f310bf337af43c248e1c6e260c1e6ea747603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# coding=utf-8

id = 118
group = 'lists'
number = 25
visible = True
facts = None

solution = '''\
sum([], 0).
sum([H|T], Sum) :-
  sum(T, SumT),
  Sum is SumT + H.
'''