Depends on the species of snake. Different snakes have different habitat requirements. Anacondas, boa constrictors, and most pythons, for example, are native to tropical rainforest habitats. Most rattlesnakes, however, are desert dwellers and are not suited to tropical climates.
-
Snakes are highly adaptable. They are found throughout the world, except on Antarctica and some remote islands. There are snakes in nearly every terrestrial habitat and in the seas. There are indeed many species of snakes living in tropical rain forests, but there also many which live in deserts. You will simply find different snakes living in different habitats, although snakes tend to avoid the hottest and/or driest parts of deserts.