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

id = 118
number = 25
visible = True
facts = None

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