Answer
In H2O,
1\times16.00amu O\div 2\times 1.01 amu H = 7.92 amu O/ amu H
In H2O2,
2\times 16.00 amu O\div 2\times 1.01 amu H = 15.84 amu O/ amu H
Work Step by Step
The mass of oxygen in these two compounds is in the ratio 7.92:15.84 or 1:2. The masses of oxygen that combine with a fixed mass of H in the two compounds are in the ratio of small whole number 1:2.
Alternatively, the masses of H that combine with a fixed mass of O could be compared.