Periodicity is extension-closed

Statement
Suppose $$G$$ is a group and $$H$$ is a normal subgroup of $$G$$ such that both $$H$$ and the quotient group $$G/H$$ are periodic groups. Then, $$G$$ is also a periodic group.

Further, if $$\pi$$ is a set of primes such that both $$H$$ and $$G/H$$ are $$\pi$$-groups -- all prime factors of orders of elements in these groups are in $$\pi$$ -- then $$G$$ is also a $$\pi$$-group.

Related facts

 * Local finiteness is extension-closed
 * Periodic not implies locally finite

Proof
We prove the second version. Note that taking $$\pi$$ to be the set of all primes will give the first version.

Given: A group $$G$$. A normal subgroup $$H$$ with quotient group $$G/H$$. A prime set $$\pi$$ such that both $$H$$ and $$G/H$$ are $$\pi$$-groups: all elements of $$H$$ and all elements of $$G/H$$ have finite orders with all prime divisors of the order of every element in $$\pi$$.

To prove: Every element of $$G$$ has finite order and every prime divisor of the order of every element is in $$\pi$$.

Proof: We pick an arbitrary element $$g \in G$$. We let $$\varphi:G \to G/H$$ be the quotient map.