atomic mass of oxygen is 16u
oxygen gas is O2. so, mass of 1 oxygen gas molecule = 16 x 2 = 32 u
So, molar mass of oxygen gas = 32 g
ie, 32 g oxygen gas = 1 mole
So, 1 g oxygen gas = 1/32 mole
So, the number of moles in 12g oxygen gas = 1/32 x 12
= 0.375 mole