python基础

# -*- coding:utf-8 -*-
from turtle import *
def mygoto(x,y):
    up()
    goto(x,y)
    down()
def drawStar(r):
    begin_fill()
    for i in range(5):
        forward(r)
        right(144)
    end_fill()
setup(400,200)
bgcolor('red')
color('yellow')
fillcolor('yellow')
mygoto(-360,200)
drawStar(100)
mygoto(-265,275)
drawStar(50)
mygoto(-205,215)
drawStar(50)
mygoto(-205,150)
drawStar(50)
mygoto(-265,105)
drawStar(50)
done()

 

posted on 2018-03-15 21:10  184陈楚浩  阅读(102)  评论(0编辑  收藏  举报