Police found the snakes, ranging from 1 foot to 4-1/2 feet in length, in a motel in Brantford, a city about 100 km (62 miles) southwest of Toronto.
"The snakes were not being suitably cared for and were in distress. The anxious officers called the Society for the Prevention of Cruelty to Animals who attended and took 40 pythons into their care," local police said in a statement.
The snakes are expected to be fine, they said. No one at the Brantford police or at the SPCA was available for comment.
A manager at the motel said the snakes belonged to a couple who had checked into a room for one night, and who were out when police arrived on Thursday evening.
Pythons are not legal for home ownership in Brantford, according to the city's animal control bylaws.
Last week, two young boys in Eastern Canada died after a 13-foot (3.96-metre), 100-lb (45-kg) python apparently attacked them in their sleep. An autopsy confirmed the two died of asphyxiation.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ