导入turtle模块
```python
import turtle
```
设置画笔的宽度和颜色
```python
turtle.pensize(10)
turtle.pencolor('yellow')
```
开始绘制四边形
```python
turtle.forward(200) 向当前画笔的方向移动200像素长度
turtle.right(90) 顺时针移动90度
turtle.forward(200) 向下画出一条200像素长度的线条
turtle.right(90) 顺时针移动90度
turtle.forward(200) 向左画出一条200像素长度的线条
turtle.right(90) 顺时针移动90度
turtle.forward(200) 向上画出一条200像素长度的线条
```
结束绘制
```python
turtle.mainloop()
```
将以上代码放在一个Python文件中运行,就可以看到一个黄色的四边形被绘制出来。
建议
调整边长和颜色:可以根据需要调整`forward`函数中的参数来改变四边形的边长,以及`pencolor`函数中的参数来改变画笔的颜色。
添加更多功能:可以尝试添加更多的turtle操作,比如改变画笔的样式、添加填充颜色等,来制作更复杂的图形。