The variance of a set of observed values that is represented by random variable $X$ is its second central moment, the expected value of the squared deviation from the mean $$
\mu = E[X]:
\operatorname{Var}(X) = \operatorname{E}\left[(X - \mu)^2 \right]$$
This definition encompasses random variables that are generated by processes that are discrete, continuous, neither, or mixed. The variance can also be thought of as the covariance of a random variable with itself:
$$\operatorname{Var}(X) = \operatorname{Cov}(X, X)$$