# 04.วาดรูปหกเหลียม

{% code title="" overflow="wrap" lineNumbers="true" fullWidth="true" %}

```python
import turtle  # นำเข้าไลบรารี turtle

t = turtle.Turtle()  # สร้างวัตถุ turtle ใหม่
t.shape('turtle')  # กำหนดรูปร่างของ turtle เป็น 'turtle'

for i in range(6):  # วาดรูปหกเหลี่ยม ทำซ้ำ 6 ครั้ง
    t.forward(100)  # เคลื่อนที่ไปข้างหน้า 100 หน่วย
    t.left(60)  # หันซ้าย 60 องศา

t.hideturtle()  # ซ่อน turtle เมื่อวาดเสร็จ
turtle.done()  # รอให้ผู้ใช้ปิดหน้าต่าง
```

{% endcode %}

<figure><img src="/files/tvJyLFjp341cFtfaVYa5" alt=""><figcaption></figcaption></figure>


---

# 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://krootee.gitbook.io/python-turtle/1.example01-10/04..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.
