00:00 Welcome to lesson three in Object-Oriented Programming in Python versus Java. In your last lesson, you discovered how to create instance attributes in Python. Now we will look at class attributes.
00:29 This would be the same value shared by any instance of the class that we create. In Python, class attributes are created by defining a variable outside of any method, usually occurring before any of the methods.
So we can say
All cars have 4 wheels. In Python, an object can actually change its own value of a class attribute, not affecting the attributes of other objects already created or yet to be created.
Become a Member to join the conversation.