Hi,
Recall that the ideal gas law is PV = nRT, so T, P and V need to be the same for n to for sure be the same for two samples.
Here, although P and V are the same, it is not said that temperature is the same, so the possibility is that these gases are at different temperatures.
In this case, the question is asking about two gases which each weigh 0.35 g, but have different molecular weights.
Due to this, we know that these molecules must have different numbers of moles, because if their molar mass is different but they weigh the same, the difference must be made up in umber of moles.
I hope this helps!
Katt