AnyDice

SEQUENCE contains NUMBER

This function yields 1 if the NUMBER occurs at least once in the SEQUENCE, otherwise it yields 0.

Examples

output [{1..6} contains 4]
output [3d6 contains 6]
output [{1..3} contains d6]

Do it yourself

function: SEQUENCE:s contains NUMBER:n{
 result: (SEQUENCE = NUMBER) > 0
}