It can be very useful to comment and uncomment multiple lines of code at once. Typing # in front of each line is cumbersome! Try these steps and keyboard shortcut instead:
Click on the line of code that you want to comment OR highlight multiple lines of code.
Use the keyboard shortcut below depending on your operating system to comment the code.
Uncomment the code by repeating the same steps and using the same keyboard shortcut!
Windows & Chromebook Users: Ctrl + /
Mac Users: Command + /
Benefits of the commenting shortcut:
Avoid typing and deleting many #’s.
Comment portions of your programs to isolate specific other sections of code for testing and debugging. Then, easily uncomment them once you’re ready to run the whole program!
The same shortcut works in most popular code editors.