Not entirely sure that I understood correctly, but this available per editor.
For example, in each editor you'll have a shortcut for commenting out/in lines at once, so it depends on the editor.
In Jupyter for example, you can use Ctrl
+ /
which works for me.
As if you're writing just in a simple notepad, I can however suggest the following three single-quotes at the start and at the end.
For example:
'''x=2
y=3
z=4
x=3'''
y=4
z=5
So the part from x=2
to the part of x=3
is currently commented out from the code and won't be executed.