A snake defecates by excreting waste out of its anal cavity, which is covered by a scale. The scale that covers the anal cavity is called the anal scale.
When a snake gets rid of the waste in its body, the anal scale moves out of the way of the anal cavity. The waste then slides out of the snake. Once the snake is done excreting its waste, the anal plate goes back into place – like other scales, it works to protect the inside of the snake's body.
The beginning of a snake's digestive process starts when the snake eats something. The food passes through the mouth into the stomach of the snake. A snake's stomach, unlike a human's, is shaped like a "J." Once the food is digested, it makes its way into the the small intestines and the large intestines. The food is processed and digested as harmful toxins, bacteria and gasses move to the liver.
Upon passing through the liver, the waste then moves to the cloacae chamber where it sits until it moves completely out of the snake's body through the anal cavity. The entire digestive process takes only a short amount of time and occurs every time a snake eats.