Given a Prolog list, for example L=(12, 25, 55, 8, 16). Write a recursive procedure that gets the sum of the items in such a list.
Answers
Answered by
0
Answer:
l=(12,25,55,8,16)
sum=0
for i in l:
sum=sum+i
print(sum)
Similar questions