subset definition code example Example: subset A is a subset of a set B if all elements of A are also elements of B