Step 1: Assume total mass of mixture = 100 g.
\[
\text{Mass of H}_2 = 20\, \text{g}, \quad \text{Mass of O}_2 = 80\, \text{g}
\]
Step 2: Calculate moles of each gas.
\[
\text{Moles of H}_2 = \frac{20}{2} = 10
\]
\[
\text{Moles of O}_2 = \frac{80}{32} = 2.5
\]
Step 3: Find mole fraction of O$_2$.
\[
\text{Total moles} = 10 + 2.5 = 12.5
\]
\[
\text{Mole fraction of O}_2 = \frac{2.5}{12.5} = 0.2
\]
Step 4: Find partial pressure of O$_2$.
\[
P_{\text{O}_2} = \text{Mole fraction} \times \text{Total pressure} = 0.2 \times 2 = 0.4\, \text{bar}
\]
Final Answer:
\[
\boxed{0.4\, \text{bar}}
\]