# 03.วาดรูปสามเหลี่ยม

{% 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(3):  # ทำซ้ำ 3 ครั้งสำหรับแต่ละด้านของสามเหลี่ยม
    t.forward(100)  # เคลื่อนที่ไปข้างหน้า 100 หน่วย
    t.left(120)     # หันซ้าย 120 องศา

turtle.done()       # เสร็จสิ้นการวาดภาพและแสดงหน้าต่าง
```

{% endcode %}

<figure><img src="/files/eKLsLpsF8cMjBqBVfzcu" 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/03..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.
