Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Basic Object-Oriented Python Welcome to OOP Class Attributes

In Workspaces, for Python, what is the keyboard shortcut to comment out highlighted lines of code?

In the Class Attributes videos of the Beginning OOP Python course, the teacher selects several lines of code and clearly uses a keyboard shortcut to comment the line out.

What is this shortcut?

1 Answer

Cameron Childres
Cameron Childres
11,817 Points

Hi Paema,

Try CTRL and /

I haven't done Python but this is the usual shortcut and I expect it to be the same. This is also common in code editors (it's the default comment shortcut in VS Code).