Tinkercad - https://www.tinkercad.com/ is an excellent tool that allows you to simulate a number of items. You can (perhaps you SHOULD) simulate all exercises and even your own designs before trying them on real hardware. It also allows you to do programming using blocks. You can download / copy-paste the generated code later into Arduino IDE to program the real Arduino board, rather than having to write it from scratch.
...
You have to click Stop Simulation to stop the simulation before you can modify your program and/or hardware connections.
To download the code