Scales protect the body of the snake, aid it in locomotion, allow moisture to be retained within and give simple or complex colouration patterns which help in camouflage and anti-predator display.
In some snakes, scales have been modified over time to serve other functions such as 'eyelash' fringes, and protective covers for the eyes with the most distinctive modification being the rattle of the North American rattlesnakes.
The shape and number of scales on the head, back and belly are characteristic to family, genus and species.
Moulting performs a number of functions: firstly, the old and worn skin is replaced; secondly, it helps to get rid of parasites such as mites and ticks.
Renewal of the skin by moulting is supposed to allow growth in some animals such as insects, however this view has been disputed in the case of snakes.
[1] Snake scales are not discrete but extensions of the epidermis, hence they are not shed separately but are ejected as a complete contiguous outer layer of skin during each moult, akin to a sock being turned inside out.
In many cases the cast skin peels backward over the body from head to tail, in one piece like an old sock.