The structures are shown in the image
.The lone electrons of N in pyrrole is delocalized . It is part of the Pi system, thus involved in aromatization . This L.P is no longer available for a proton hence it is a weak base.
One the other hand, aniline is already aromatic. Through the lone pair of e− of −NH2 group of aniline is delocalized over the benzene ring, it is not involved in aromatizetion . This pair of lone electron still available for a proton, hence aniline is stronger base than pyrrole.
![1021054_878180_ans_c2a39626f52a497ebfec84db525f13be.png](https://search-static.byjusweb.com/question-images/toppr_invalid/questions/1021054_878180_ans_c2a39626f52a497ebfec84db525f13be.png)