博客
关于我
Python基础综合练习
阅读量:796 次
发布时间: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 中如何创建多行字符串?
查看>>
Python 中如何处理异常?
查看>>
Python 中如何实现列表的切片?
查看>>
Python 中如何实现字典的排序?
查看>>
Python 中常用的数据类型及相关操作详解
查看>>
python 中文乱码
查看>>
Python 中生成器与普通函数的区别
查看>>
Python 中的多进程(02/2):进程之间的通信)
查看>>
Python 中的字符串、列表、元组和字典数据类型的特点和使用场景
查看>>
Python 中的属性访问器是什么?如何使用 @property 装饰器?
查看>>
Python 中的带宽限制
查看>>
Python 中的机器学习简介:多项式回归
查看>>
Python 中的注意点_s2
查看>>
Python读取Excel的几种工具包(附Demo)
查看>>
Python 中的生成器是什么?
查看>>
Python 中的离线语音转文本
查看>>
Python读写json文件的简单实现
查看>>
Python 中的线程
查看>>
Python 中的继承机制是什么样的?
查看>>
python读写excel之xlrd&xlwt&xlutils组合
查看>>