P. affinis is found in southern parts of Western Australia and in remote coastal parts of western
South Australia. The dugite occupies a wide variety of habitats ranging from coastal dunes and heathlands to shrub lands and woodlands. It also appears to thrive in heavily degraded habitats such as golf courses, industrial areas, and open agricultural farmlands. The dugite has increased in population since the opening up of its natural habitats and introduction of the house mouse due to the mouse being a main food source for it. In the
Perth metropolitan area, the dugite is one of the most common snakes found next to buildings. In areas of human population, the snake will take temporary shelter under concrete slabs, fibro sheeting, roofing tin, and such, although in more natural habitats, it will shelter under rocks and in abandoned termite mounds. It also burrows during the winter. ==Behaviour==