Hi,
I am using Visual Studio 2019 as my IDE for writing python codes.
I was wondering how an earth do you add comments to a block of code?
I can't see any options in the menu bar.
Thanks!
# This is a one line comment in Visual studio. The below one is multiline
"""
This is a comment
This is another comment
"""
Basically, when you want a comment, the best way is to think of it as hashtag. You put # on the line of code you want the interpreter to ignore.
What I meant was is there a button in Visual Studio to comment out a block of code in python?
select a block of code and press ctrl+/
I have windows and i tried ctrl + / and it didn't do anything
(May-24-2020, 10:07 AM)mp3909 Wrote: [ -> ]I have windows and i tried ctrl + / and it didn't do anything
Probably you are doing something wrong. Attached is screenshot from VS Code under Windows, EDIT menu.
As you can see shortcut for
Toggle Line Comment is
Ctrl + /
and shortcut for
Toggle Block Comment is
Shift + Alt + A
[
attachment=886]