CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day10/turtle1.py
Views: 729
1
"""
2
3
用turtle模块绘图
4
这是一个非常有趣的模块 它模拟一只乌龟在窗口上爬行的方式来进行绘图
5
6
Version: 0.1
7
Author: 骆昊
8
Date: 2018-03-14
9
10
"""
11
12
import turtle
13
14
turtle.pensize(3)
15
turtle.penup()
16
turtle.goto(-180, 150)
17
turtle.pencolor('red')
18
turtle.fillcolor('yellow')
19
turtle.pendown()
20
turtle.begin_fill()
21
for _ in range(36):
22
turtle.forward(200)
23
turtle.right(170)
24
turtle.end_fill()
25
turtle.mainloop()
26
27