No, polymers are not always hydrocarbons. While many polymers are derived from hydrocarbons, such as polyethylene and polypropylene, there are numerous polymers that contain elements other than carbon and hydrogen.
Polymers are large molecules composed of repeating subunits called monomers. The monomers can consist of a variety of elements, including carbon, hydrogen, oxygen, nitrogen, sulfur, and others. The presence of different elements in the monomers gives rise to polymers with diverse properties and applications.
For example, polyvinyl chloride (PVC) is a polymer that contains carbon, hydrogen, and chlorine atoms. Polyacrylonitrile (PAN) is a polymer that contains carbon, hydrogen, nitrogen, and oxygen atoms. Polyethylene terephthalate (PET) is a polymer that contains carbon, hydrogen, and oxygen atoms, among others.
Therefore, polymers can be composed of a range of elements, and they are not limited to hydrocarbons.