In simple words, we can say that the lone pair of nitrogen in pyrrole will be in resonance, so it cannot be donated, whereas the lone pair of nitrogen in pyridine is localized and hence, it can easily donate hydrogen ions. Therefore, pyridine is more basic than pyrrole.
Why is pyrrole a weaker base than pyridine?
Pyrrole is a much weaker base than pyridine (see above). This is because the lone pair on the N atom is already involved in the aromatic array of p electrons. Protonation results in loss of aromaticity and is therefore unfavourable.
Why pyridine is more basic than pyrrole explain?
Pyridine is like benzene but an N has replaced one CH. The N atom is weakly basic since the lone pair is in an sp2 hybrid orbital. Pyrrole is a much weaker base than pyridine (see above). This is because the lone pair on the N atom is already involved in the aromatic array of p electrons.