How to comment bunch of codes simultaneously in Replit


To comment out multiple lines of code simultaneously in Replit, you can use a keyboard shortcut. Here are the steps to do this:

  1. Highlight the lines of code that you want to comment out.
  2. Press the Ctrl key and the / key simultaneously (on Windows and Linux) or the Command key and the / key simultaneously (on Mac).

This will add a # symbol at the beginning of each selected line, which comments out the code. Here’s how your code will look like after commenting out the lines:

# 2d
# 2+2+2
# print(‘2+2’)

In Replit, you can comment out a block of code by highlighting the code you want to comment and then pressing the “Ctrl” and “/” keys at the same time. This will add a comment symbol (#) to the beginning of each line of code, effectively commenting out the entire block

To comment a block of codes can add # in front of every line-this will keep the indentations too. can also you use control+/ to the chunk


One handy way to comment out multiple lines at once is using double quotes thrice like so:


This is going to skip the three lines in triple double quotes, and run the remaining.
Although technically this is not a comment, it is docstring. But is achieves the same.
Read more about it here.

Happy Coding :slight_smile:

Select the lines you want to comment out ,then
Use ‘Ctrl’ +’ /’
‘command’ +‘/’(MAC users)

You can comment different codes simultaneously by using (“”") before and after the chunk of comments to make it easier.

To comment a bunch of lines
Select all the lines you want to be commented out
Ctrl + / = Windows
Command + / = Mac
And you are done