I was the given the following proof that $\mathbb{C}^2\setminus(0,0)$ is not an affine variety: $\mathcal{O}(\mathbb{C}^2\setminus(0,0))=\mathbb{C}[x,y]$, and if it were an affine variety then $\mathcal{O}(\mathbb{C}^2\setminus(0,0))=\mathbb{C}^2$. Why is that true?
for projective varieties I know that every regular function is constant. Is there anything similar on affine varieties?