The examples below use sequence without definition blocks which are preferred to better organize the code. See https://pc-microbit-micropython.readthedocs.io/en ...
// Define pins for LEDs const int led1 = 13; const int led2 = 2; const int led3 = 3; const int potPin = A0; // Potentiometer connected to A0 int potValue = 0; // Variable to store potentiometer value ...