# 19.หกเหลี่ยมซ้อนเหลี่ยม

```python
// Some code
import turtle	        #นำเข้าโมดูล turtle ซึ่งใช้สำหรับการวาดกราฟิก
t = turtle.Turtle()	#สร้างวัตถุเต่าชื่อ t เพื่อใช้ในการวาด
t.shape('turtle')	#กำหนดให้รูปร่างของเคอร์เซอร์เป็นรูปเต่า
t.color('blue')	        #กำหนดสีของปากกาที่ใช้วาดเป็นสีน้ำเงิน
t.width(2)	        #กำหนดความหนาของปากกาเป็น 2 หน่วย
for _ in range(6):	#เริ่มลูปภายนอกซ้ำ 6 รอบ (สำหรับการหมุนเคอร์เซอร์เพื่อวาดหกเหลี่ยมทั้งหมด 6 ด้าน)
    for _ in range(6):	#เริ่มลูปภายในซ้ำ 6 รอบ (สำหรับการวาดแต่ละด้านของหกเหลี่ยม)
        t.fd(60)	#วาดเส้นตรงไปข้างหน้า 60 หน่วย
        t.rt(60)	#หมุนหัวปากกาทางขวา 60 องศา (เพื่อเตรียมวาดเส้นต่อไปสำหรับหกเหลี่ยม)
    t.rt(60)	        #หมุนหัวปากกาทางขวา 60 องศาหลังจากวาดหกเหลี่ยมเสร็จ (เพื่อหมุนเต่าไปยังตำแหน่งสำหรับการวาดหกเหลี่ยมถัดไป)
turtle.exitonclick()    #รอให้ผู้ใช้คลิกที่หน้าต่างเพื่อปิดหน้าต่างกราฟิก
```

<figure><img src="/files/qQytuODAAyqyZrUM00ls" 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/2.example11-20/19..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.
