> For the complete documentation index, see [llms.txt](https://krootee.gitbook.io/python-turtle/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krootee.gitbook.io/python-turtle/2.example11-20/11..md).

# 11.วาดรูปรูปหัวใจ

```python
// Some code
from turtle import *    # นำเข้าโมดูล turtle ทั้งหมด เพื่อใช้ในการเขียนกราฟิก
pensize(3)              # กำหนดความหนาของปากกาเป็น 3 หน่วย
pencolor('red')         # กำหนดสีของปากกาเป็นสีแดง
lt(45)                  # หมุนทิศทางของหัวปากกาทางซ้าย 45 องศา
fd(100)                 # วาดเส้นตรงไปข้างหน้าเป็นระยะ 100 หน่วย
circle(50,180)          # วาดครึ่งวงกลม (180 องศา) มีรัศมี 50 หน่วย
rt(90)                  # หมุนทิศทางของหัวปากกาทางขวา 90 องศา
circle(50,180)          # วาดครึ่งวงกลมอีกครั้งเหมือนเดิม
fd(100)                 # วาดเส้นตรงไปข้างหน้าเป็นระยะ 100 หน่วย
mainloop()              # รักษาหน้าจอการวาดกราฟิกให้ค้างอยู่เพื่อให้เห็นผลลัพธ์

```

<figure><img src="https://1059722861-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWAMRQLhtfzfy8yv80Se5%2Fuploads%2F5o2ez36YlbVq8GRNmXZZ%2F1.png?alt=media&amp;token=86bf6459-5f79-4b33-ba9a-31a16b5906f6" alt=""><figcaption></figcaption></figure>
