A keyboard is an input device that is used to enter data into a computer or other electronic device. It consists of a set of keys that are pressed to input characters or commands. When a key is pressed, it sends an electrical signal to the computer, which translates the signal into the corresponding character or command.