๐Ÿ“ฆ Anurag-05-prog / Prolog

๐Ÿ“„ List_Len.md ยท 14 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14# Q. Length of the list

## Code

len([],L):-write(L).

len([_|T],L):-
    L1 is L + 1,
    len(T,L1).

## Query

len([5,2,9,5],L).