Python Class
Last updated
Last updated
Besides list, tuple, string, dictionary, set are data structure, you can define class that has attributes
For example
wheel_number, seal_row_number are class attributes, class attributes can be of any data type, include
list, tuple, string, dictionary and set
You notice class can also have methods, __init__() is called constructor method, it runs when instantiating a class, for example
small_car=car("toyota")
small_car.brand
'toyota’
small_car.seal_row_number
2