博客
关于我
Python基础综合练习
阅读量:801 次
发布时间:2023-03-07

本文共 612 字,大约阅读时间需要 2 分钟。

import turtle
def mygoto(x, y):
turtle.penup()
turtle.goto(x, y)
turtle.pendown()
def draw(z):
turtle.begin_fill()
for i in range(5):
turtle.forward(z)
turtle.right(144)
turtle.end_fill()
turtle.setup(700, 500, 0, 0)
turtle.color("yellow")
turtle.bgcolor("red")
turtle.fillcolor("yellow")
mygoto(-220, 75)
draw(100)
for i in range(4):
x = 1
if i in [0, 3]:
x = 0
mygoto(-100 + x * 30, 135 - i * 50)
turtle.left(0 - i * 10)
draw(30)
mygoto(0, 0)
turtle.hideturtle()
turtle.done()

转载于:https://www.cnblogs.com/qq157049540/p/8600256.html

你可能感兴趣的文章
Python-Numpy的tile函数用法
查看>>
python-open函数
查看>>