One of the main drivers behind the development of the Pi line is as a base for electronics projects, and it excels in this area. Things such as sensors, LEDs, relays, and motor controllers can be attached using those 40 GPIO pins, and a language such as Python used to control them.
And then, literally on top of that, there are HATs. Standing for Hardware Attached on Top, HATs add additional functionality to a Pi by clipping on top of the board and connecting to the GPIO pins. Basic examples include power over Ethernet, or USB 3.2 ports. Then there are e-ink screens, electronics breadboards, LED traffic lights, air quality measurement devices, hi-fi sound output (the Pi 4 has a 3.5mm audio jack, and Bluetooth, as its native audio out),…