Step-by-step explanation:
Lone pairs are present on nitrogen atoms of both pyridine and pyrrole.
In pyrrole, the electron pair on nitrogen is involved in resonance and hence does not available for bonding. Therefore, pyrrole does not possess basic character and remains unreactive towards HCl.
In case of pyridine, as 6 pi electrons are present in the ring, so, electron pair of nitrogen does not participate in resonance. So, because of presence of lone pair, pyridine possess basic character and hence, reacts readily reacts with HCl.