Solution (source code)

= Solution

Each ticket is equally likely, so the supplied sums give
$$
\mathbb E X=\frac{40}{10}=4,\qquad\mathbb E X^2=\frac{216}{10}=\frac{108}5.
$$
Hence
$$
\boxed{\mathbb E X=4,\qquad\operatorname{Var}(X)=\mathbb E X^2-(\mathbb E X)^2=\frac{28}5=5.6.}
$$
Repeated numerical values still represent different equally likely tickets; they must retain their multiplicities.