For instance, $$X = \begin{cases} Y, & \text{with probability} ~0.3,\\ Z, & \text{with probability} ~0.7, \end{cases}$$ where $Y$ and $Z$ are random variables with known distributions.
How does one find the expectation of $X$
For instance, $$X = \begin{cases} Y, & \text{with probability} ~0.3,\\ Z, & \text{with probability} ~0.7, \end{cases}$$ where $Y$ and $Z$ are random variables with known distributions.
How does one find the expectation of $X$
As @whuber commented, the representation of $X$ is conditional on $Y$ and $Z$. That is, conditional on $Y$ and $Z$, $X$ behaves like a Bernoulli random variable. Therefore, $$ E(X\mid Y,Z) = 0.3 Y + 0.7Z. $$ This gives us $E(X) = 0.3E(Y) + 0.7 E(Z)$. A minor remark would be that what you wrote in the original post is typically how we construct a mixture distribution.