In Jupyter Notebook (or JupyterLab), you can comment/uncomment multiple lines at once using a keyboard shortcut:
Windows/Linux → Select the lines you want to comment, then pressCtrl + /
Mac → Select the lines you want to comment, then pressCmd + /
This will toggle comments:
# at the beginning of each selected line.#.Alternative: You can also manually add # at the start of each line, but the shortcut is much faster.