This sounds like a completely stupid question, but when you actually look into it further this may just change your mind.
It is thought that snakes have evolved from a species of lizard years ago and when you look closer are the under-tail end of a boa constrictor for example, they have what looks like rear legs buried within the muscle of the snake.
This is a possibility that these was legs millions of years ago, but now these are actually use when a snake breed with another to entice the female snake.
These “Vestigial legs” that remain on a snake are similar to what lizards’ legs are, as shown in the picture you can see that the just look like little spikes or snake claws.
Snakes that have legs today
Unfortunately, snakes today do not have legs, though that said, there is a legless lizard.
This may seem strange that a legless lizard is not just called a snake, but in fact have the anatomy of a lizard but have no legs and therefore cannot be identified as a snake species.
In 2015, a four-legged fossil was found of the world’s first 4-legged snake being proven to exist in the past, more information on this fossil is found here
How snakes live without legs
Snakes have adapted very well to life without legs in the wild.
On the underbelly of the snake, they have scales that run the width of their body which they move back and forth to propel themselves forwards.
Climb is also easier for a snake without legs, as they can circle a branch and move the top half of the body up the tree and anchor, then following up with the lower half of the body.
It is amazing how snakes have not only survived without legs in the wild but have thrived for many years and will continue for millions of years to come.