Once, long ago in the course of their evolution, snakes had legs.
They are actually descended from the same family as lizards. However, they gradually lost their legs as it became more efficient for them, in terms of energy conservation, to slither.
Some primitive snakes, like the boa constrictor and the python, still have remnants of their legs, called spurs.
These don’t serve any purpose in locomotion, but, yippee-i-o-ki-ay! they sure tickle the ladies.
We mean that literally, they’re sometimes used by male snakes to stimulate female snakes during courtship and mating.