Getting started with Raspberry Pi GPIO and Python
How to use the Raspberry Pi GPIO using gpiozero
library.
Introduction
A Rasberry Pi (RPi) is a low cost mini computer and has the size of a credit card. It is a great solution for hobby and home projects (and some commercial, too) because it has various input/output pins, video, camera, sound interfaces and many good OSes to install.
One the main characteristics of a RPi is its GPIO pins. GPIO stands for General-Purpose Input/Output. These pins are the interface with the external world.
In a simple way, you can think them as switches that you can read the status (inputs) and lamps that you can turn on or off (outputs).
Layout
The Raspberry Pi contains 40 GPIO pins, distributed as the image below.
As you can see, some inputs can also have other functions than just input or output.