What is the basic function of a semiconductor?

Explanation:

Semiconductors are materials that can conduct electricity under certain conditions, making them ideal for use in electronic devices like transistors and diodes.