python画图模块之一:turtle(1) 画五角星、正方形等

# -*- coding:utf-8 -*-
# 2017-8-10 10:32:44
import turtle
import time
turtle.color("red")
for i in range(60):
    turtle.forward(200)
    turtle.right(110)  # 角度
    time.sleep(0.01)
time.sleep(200)

 

五角星只需要把角度调整为144

正方形:90

 

posted on 2017-08-10 11:08  零零Java  阅读(2156)  评论(0编辑  收藏  举报

导航