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


Omar Farag
Omar Farag
4,573 Points

What are classes in Python?

So I'm in a python track and I just finished one part of the course and went to the next. Kenneth starts mentioning classes but I have no idea what they are, and he never mentioned them before. Any idea on what they are and what they do? Thanks

Omar Farag
Omar Farag
4,573 Points

I also have no idea what 'from re import is'. Does anyone know the course where these things are introduced? I can't seem to find it.

1 Answer

I know, it won't satisfy you but a really good answer to you question what classes are is listed here: https://docs.python.org/3/tutorial/classes.html

So in generell it is as in all other programming languages as well, classes are objects and class-objects group functions. You can import class-objects to other python scripts/ classes and so on to use the functions from a class-object.

more specific here: https://docs.python.org/3/tutorial/classes.html#class-definition-syntax

"from re import is'." imports the class is from the python-package re