Some animals, such as frogs and toads, spend the first parts of their lives in water and the last part on land.
Frogs begin life as eggs and hatch as tadpoles. Tadpoles have gills so they can extract oxygen from the water.
Later on they develop legs and lose their tails. At the same time they grow lungs and lose their gills. Now they must breathe air.