Python基础综合练习

import turtle
import sys
print(sys.argv)
turtle.bgcolor('red')
turtle.color('yellow')
turtle.setup(600,400,0,0)
turtle.fillcolor('yellow')

def mygoto(x,y):
    turtle.up()
    turtle.goto(x,y)
    turtle.down()

def drawstar(r):
    turtle.begin_fill()
    for i in range(5):
        turtle.forward(r)
        turtle.right(144)
    turtle.end_fill()

mygoto(-250,100)
turtle.begin_fill()
for i in range(5):
    turtle.forward(120)
    turtle.right(144)
turtle.end_fill()

mygoto(-120,140)
turtle.left(31)
drawstar(40)
turtle.setheading(0)

mygoto(-80,110)
turtle.left(-18)
drawstar(40)
turtle.setheading(0)

mygoto(-80,50)
turtle.left(0)
drawstar(40)


mygoto(-120,0)
turtle.left(31)
drawstar(40)
turtle.hideturtle()
turtle.done()
原文地址:https://www.cnblogs.com/Brilliance-pan/p/8610548.html