I am having trouble deciding what formula to use for the following problem. Any help would be appreciated.

Magnesium in flashbulbs burns according to the equation
2 Mg (s) + O2 (g) --> 2MgO (s)
What mass of Mg combines with 5.80 L of O2 measured at STP?

3 answers

Convert 5.80 L O2 to moles.
(1 mole of O2 at STP = 22.4 L)
Since 2 moles Mg combine with 1 mole O2,
moles of Mg = (2)(moles O2)
Grams Mg = (moles Mg)(24.3 g Mg/mol Mg)
Thank you!
what is the correct answer for this?