python绘图库turtle 五角星绘制

 1 import turtle
 2 # 绘制五角星
 3 turtle.pensize(5)
 4 turtle.color("red")
 5 turtle.write("0,0")
 6 turtle.forward(300)
 7 
 8 # 改变方向
 9 for i in range(4):
10     turtle.right(144)
11     turtle.forward(300)
12 turtle.done()


python绘图库turtle 五角星绘制_第1张图片

 

转载于:https://www.cnblogs.com/itBulls/articles/8451325.html

你可能感兴趣的:(python)