In Chapter Fourteen of Harry Potter and the Prisoner of Azkaban we have the following passage:
Neville was in total disgrace. Professor McGonagall was so furious with him she had banned him from all future Hogsmeade visits, given him a detention, and forbidden anyone to give him the password into the tower. Poor Neville was forced to wait outside the common room every night for somebody to let him in, while the security trolls leered unpleasantly at him.
I am trying to understand the logistics of this punishment. Even if no one was allowed to tell Neville the password, he would still hear it when someone let him in. Why then would he need someone to let him in every night? After the first night he would already know the password himself.