Function reference · Math
contains
Returns 1 if a vector, set, solution set or dictionary contains a value, and 0 otherwise.
For a dictionary it checks the keys. For anything else, the call is returned unevaluated.
Notation
contains(x, value)
Write it in an expression: nerdamer('contains([x,1,2],1)'), or in the Playground.
nerdamer.contains
nerdamer.contains(x: Expression | Vector | ValuesSet | Dictionary | SolutionSet, value: ExpressionInput): Expression
A method on the default import. Arguments can be strings, as in Notation.
Examples
Deprecated names
Deprecated.
is_in still works, and gives the same result as contains, but each call records an api.deprecatedFunction warning. Use contains instead; the old name will be removed in a later major version.
