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   181冯荣彬  阅读(90)  评论(0编辑  收藏  举报

努力加载评论中...

导航

点击右上角即可分享
微信分享提示