** suivant:** Sum of list (or
** monter:** Lists and vectors
** précédent:** Test if a value
** Table des matières**
** Index**

##

Test if a value is in a list : `contains`

`contains` takes as argument a list (or a set)
`L` and a value `c`.

`contains` tests if `c` is an element of the list `L`.

`contains` returns `0` if `c` is not in `L`,
or a strictly positive integer which is
1+the index of the first occurence of `c` in `L`.

Input :
`contains([0,1,2,3,4,2],2)`

Output :
`3`

Input :
`contains(%{0,1,2,3,4,2%},2)`

Output :
`3`

giac documentation written by Renée De Graeve and Bernard Parisse