py 二级习题(turtle)
用turtle画一个正方形
import turtle
turtle.penup()
turtle.goto(-100,-100)
turtle.pendown()
turtle.goto(-100,-100)
turtle.pendown()
turtle.begin_fill()
turtle.color("blue","green")
for i in range(4):
turtle.forward(200)
turtle.left(90)
turtle.end_fill()
turtle.pencolor("red")
turtle.penup()
turtle.goto(-20,100)
turtle.pendown()
turtle.write("汪星人", font = ("times", 15, "bold" ))
turtle.penup()
turtle.goto(-20,-130)
turtle.pendown()
turtle.write("喵星人", font = ("times", 15, "bold"))
turtle.penup()
turtle.goto(-20,-130)
turtle.pendown()
turtle.write("喵星人", font = ("times", 15, "bold"))
turtle.hideturtle()