Use the equation for the ideal gas law:
#PV=nRT#,
where:
#P# is pressure, #V# is volume, #n# is moles, #R# is the gas constant, and #T# is temperature in Kelvins.
STP is #0^@"C"# or #"273.15 K"# and #10^5 "Pa"# or #"100 kPa"#.
Organize the data.
Known
#P="100 kPa"#
#V="18.0 L"#
#R="8.31447 L kPa K"^(-1) "mol"^(-1)"#
#T="273.15 K"#
Unknown
#n#
Solution
Rearrange the equation to isolate #n#. Plug in the known values and solve.
#n=(PV)/(RT)#
#n=(100color(red)cancel(color(black)("kPa"))xx18.0color(red)cancel(color(black)("L")))/(8.31447 color(red)cancel(color(black)("L")) color(red)cancel(color(black)("kPa")) color(red)cancel(color(black)("K"))^(-1) "mol"^(-1)xx273.15color(red)cancel(color(black)("K")))="0.793 mol"#
At STP, #"18.0 L H"_2"# contains #"0.793 mol"#.
Note: If your teacher is still using #"1 atm"# for standard pressure, substitute #"1 atm"# for #P#, and #"0.08206 L atm K"^(-1) "mol"^(-1)"# for the gas constant, #R#. This will give you #"0.803 mol"#.