# 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

![](/files/-M1fdAlWiwkc7yE7f3gh)

2


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://george-jen.gitbook.io/data-science-and-apache-spark/data-structure.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
