Whether you live in Toronto, Paris, or Bangkok, animals - attracted to moisture, warmth, water sources - will often find their way inside your home.

Last month, a large python measuring three to five feet was found in a sewer grate in Toronto. In this instance, however, it was luckily found before it could make its way into someone's toilet.

How do snakes, birds, bats, squirrels and other animals end up indoors and how can homeowners avoid a scare during a midnight trip to the bathroom?

They gain access through the sewer and plumbing system, exhaust pipes, chimneys, and cracks and crevices around the home, said Bill Dowd, president of Skedaddle Humane Wildlife Control in an interview with CTV’s Your Morning.

Snakes can work their way through the pipes in a sewer system, for example, since much of it is dry, said Dowd, who gets calls about these types of incidents about once a month. "The only water is in the toilet bowl underneath the toilet. So they only have a small area to go through the water and then they pop up inside the toilet."

There have been a number of media reports over the years of homeowners in different parts of the world being bitten by snakes inside the toilet.

Earlier this year, a woman in Brisbane was startled by a sharp tap when she went to the bathroom in the dark only to find a 1.6-metre long carpet python camped inside the bowl. A Florida man was bitten in the arm in May when a four-foot-long snake rose up from the toilet. A Bangkok man had a gruesome encounter in 2016 when a snake sank its fangs onto his penis. The toilet in that instance had to be dismantled to remove the snake.

Animal proofing your home is the best solution to prevent unwanted guests from paying a visit. Make sure there are grates, mesh, or wire screen covers around pipes and other vent openings around the house, said Dowd. Once animals are inside the house, they often end up in the toilet because it is the one part of the home with an open, standing water source.

"I'm not certain they want to be in toilets or in the sewer system. But animals learn by behaviour. Like a raccoon gets into your roof one way, he’ll get into other homes the same way. So they’re highly intelligent," Dowd said. "Obviously you’ll want to be checking your toilet before you’re using it."