The excercise 1.4.8(a) of Hartshorne's Algebraic Geometry says
Show that any variety of positive dimension over $k$ has the same cardinality as $k$.
Using Hartshorne's notation, we define a quasi-affine variety as an open subset of an affine variety. I was able to prove the hint given in the excercise based on this claim
Claim. Let $X$ be an affine variety and $W\subset X$ a quasi-affine variety, then $|X| = |W|$
Over $\mathbb A^1$ its obvious, but I can't prove the general case. Any help would be appreciated.