Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python

Omar Farag
Omar Farag
4,571 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,571 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