# Python Class

### Data structure

Besides list, tuple, string, dictionary, set are data structure, you can define class that has attributes

For example

```
class car(object):
    wheel_number=4
    seal_row_number=2
    
    def __init__(self,brand):
        self.brand=brand
```

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

![](https://2100080250-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M1PNTHVApkPePuMdTu3%2F-M1fbJhj77XTmXMxbhaJ%2F-M1fdAlWiwkc7yE7f3gh%2Fpython4.jpg?alt=media\&token=d615e90c-7cd0-4e42-aaf1-053b8eec39fc)

2
