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(800,500)
bgcolor('red')
color('yellow')
fillcolor('yellow')
mygoto(-335,125)
drawStar(100)
mygoto(-240,200)
drawStar(50)
mygoto(-180,140)
drawStar(50)
mygoto(-180,75)
drawStar(50)
mygoto(-240,30)
drawStar(50)
done()

 

  

posted @ 2018-03-20 10:49  186-叶晓钿  阅读(70)  评论(0编辑  收藏  举报