亲宝软件园·资讯

展开

python第一次作业

宋世豪 人气:0
import turtle
turtle.pensize(2)
turtle.pencolor("black")
turtle.fillcolor("red")

turtle.begin_fill()
for i in range(5):
    turtle.forward(300)
    turtle.right(144)
turtle.end_fill()

import turtle
turtle.pensize(2)
turtle.pencolor("black")
turtle.fillcolor("red")

turtle.begin_fill()
turtle.left(90)
turtle.fd(100)
for i in range(2):
    turtle.right(120)
    turtle.fd(300)
turtle.right(120)
turtle.fd(200)

turtle.right(60)
turtle.fd(200)
for i in range(2):
    turtle.right(120)
    turtle.fd(300)
turtle.right(120)
turtle.fd(100)
turtle.end_fill()

import turtle
t = turtle
t.pensize(2)
t.pencolor("black")
t.fillcolor("yellow")

t.begin_fill()
t.fd(200)
for i in range(2):
    t.right(120)
    t.fd(200)

t.right(60)
t.fd(200)
for i in range(2):
    t.right(120)
    t.fd(400)
t.right(120)
t.fd(200)
t.end_fill()

加载全部内容

相关教程
猜你喜欢
用户评论