The number of moles in a sample can be calculated using Avogadro's number, which is equal to 6.022 x 10^23 atoms per mole. To find the number of moles in a sample containing 2.71 x 10^24 atoms of iron, we can divide the number of atoms by Avogadro's number:
Number of moles = (2.71 x 10^24 atoms) / (6.022 x 10^23 atoms/mole)
= 4.5 moles
Therefore, the sample contains 4.5 moles of iron.