Answer:
For a discrete probability distribution, you add up x*P(x) over all possible values of x, where P(x) is the probability that the random variable X takes the value x.
For a continuous distribution you need to integrate x*P(x) with respect to x.