= Solution
Write $A=k[x,y]$. If $\dim Z=1$, its prime ideal has height one and is generated by an <irreducible polynomial> $f$, because $A$ is a <unique factorization domain>. Then $U=D(f)$ is a <principal open subscheme> and
$$
H^0(U,\mathcal O_U)=A_f=k[x,y,f^{-1}].
$$
If $\dim Z=0$, its complement has codimension two. Since $\mathbb A_k^2$ is <normal scheme>[normal], regular functions extend across that codimension-two subset, giving
$$
H^0(U,\mathcal O_U)=k[x,y].
$$
This includes the calculation for the <punctured affine plane>. If $Z=\mathbb A_k^2$ has dimension two, then $U$ is empty and its ring of sections is the zero ring.
Back to article page