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 Python Basics (2015) Python for Beginners The Python Shell

Louis chuk
Louis chuk
162 Points

What is a class? Why does a class have methods?

I am a beginner in python. I am not familiar to the family of the data type. Can anyone tell me the classification of the data type?

2 Answers

Hey Louis,

A class is a type of object. You can give objects properties and functions, like in real life. Like a lamp, it may have a color(attribute), shape(attribute), or the ability to turn on and off(a method).

Rex Orioko
Rex Orioko
3,234 Points

Sounds cliche, but everything is an object