Tired of typing # on every line in Python? Most editors (VS Code, PyCharm, Jupyter) have a shortcut that makes this instant:
Windows/Linux: Ctrl + /
Mac: Cmd + /
*How it works:
*
Highlight the lines you want to comment or uncomment.
Press the shortcut.
Done! Press again to remove the comments.
x = 10
y = 20
print(x + y)
Highlight and hit Ctrl + / → all lines get commented out in one go. Press again → they’re back!
A tiny shortcut, but a huge time-saver when debugging or experimenting.
Top comments (0)