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 Object-Oriented Python Instant Objects What Are Objects And Classes?

Juneau Lim
Juneau Lim
13,362 Points

What is the difference between attribute and instant variable?

When I learn Java, I learned as the variables inside a class are instant variable. But in here, they are saying they are attributes.

What is the difference between the two, if there is any?

1 Answer

Michael Hulet
Michael Hulet
47,913 Points

"Attribute" and "instance variable" are just 2 different terms for the same concept. They're both variables that belong to a single instance of a particular class. You might also hear them be called "properties" at some point (probably by someone like me who writes Objective-C and Swift all day, though in Python a property is subtly different, but you'll learn about that later), but they're all just different terms for the same thing

Juneau Lim
Juneau Lim
13,362 Points

Whew, I'm relieved. Thanks so much for clarifying!