Solution (source code)

= Solution

An <indicator random variable> equals $1$ with probability $p$ and $0$ with probability $1-p$, so $\mathbb E(X_i)=1\cdot p+0\cdot(1-p)=p$. Also $X_i^2=X_i$ pointwise, whence
$$
\boxed{\mathbb E(X_i)=\mathbb E(X_i^2)=p.}
$$