The Cantor set is constructed as the intersection of closed sets formed as follows:
first, let $$C_1=I_{1,1}\cup I_{1,2}$$
where $I_{1,1}=[0,1/3]$ and $I_{1,2}=[2/3,1]$. Even though it is still a little bit early convince yourself that those numbers in $I_{1,1}$ are precisely those whose first digit in ternary expansion $.d_1d_2...$ is 0 with the exemption of $1/3$ which can be written in ternary form in two different ways: $1/3=.1$ and $1/3=.0222222...$. If we admit only the second of this representations then there are no exemptions. Note that in the same fasion the numbers in $I_{1,2}$ are those that begin with the digit 2, then again, we can write $1=.2222222...$ in ternary coordinates.
Not let $C_2 = I_{2,1}\cup I_{2,2} \cup I_{2,3} \cup I_{2,4}$ where the intervals $I_{2,1},I_{2,2},I_{2,3},I_{2,4}$ stand for $[0,1/9],[2/9,1/3],[2/3,7/9],[8/9,1]$. As you can see we obtain two subintervals from each interval in the previous step by removing the middle third. The elements in $I_{2,j}$ for $j=1,2,3,4$ are precisely those with initial patterns $.00,.02,.20,.22$ respectively (once more we have to be careful with those number with two representations and chose the one that begins with lower digit, e.g., $2/9=.00222...$). Note also that $C_2 \subset C_1$.
Inductively, define $C_k$ a subset of $C_{k-1}$ as the union of the subintervals obtained by removing the middle thirds to each subinterval in $C_{k-1}$ This fixes the initial ternary digit patterns of an element in $C_k = \bigcap_{i=1}^k C_i$ up to the $k$th digit with only digits 0 and 2.
The Cantor set is precisely $\bigcap_{i=1}^\infty C_i$ and therefore its elements are precisely those whose digits are only $0's$ and $2's$.