Example. [009U]

Let \mathrm {Shp} = \{ \diamond , \triangle , \square \}. Now define a function g : \mathrm {Shp} \to \mathbb {N} by \begin {align*} g(\diamond ) &= 6 \\ g(\triangle ) &= 6 \\ g(\square ) &= 32. \end {align*} This is a valid function since every element of \mathrm {Shp} is assigned to exactly one element of \mathbb {N}. The domain of g is \mathrm {Shp}, the codomain is \mathbb {N}, and the range of g is the set \{6,32\}.