Sometimes Bagheera the Black Panther would come lounging through the jungle to see how his pet was getting on , and would purr with his head against a tree while Mowgli recited the day 's lesson to Baloo .