发布网友 发布时间:2022-04-19 14:54
共1个回答
热心网友 时间:2022-04-18 02:16
摘要import turtle def run(angle, lenth): turtle.seth(angle) turtle.fd(lenth) def change(x, y): turtle.penup() turtle.goto(x, y) turtle.pendown()def init(): turtle.pensize(10) turtle.pencolor("purple") turtle.setup(800, 400, 200, 200)init()#wuchange(-350, 100)run(0, 100)run(-90, 70)run(180, 100)run(90, 70)change(-350, 0)run(0, 100)change(-400, -50)run(0, 200)change(-30咨询记录 · 回答于2021-11-06怎样用turtle画出自己的名字您好,下面是用turtle画出自己名字的相应代码,您可根据您的需求来改写import turtle def run(angle, lenth): turtle.seth(angle) turtle.fd(lenth) def change(x, y): turtle.penup() turtle.goto(x, y) turtle.pendown()def init(): turtle.pensize(10) turtle.pencolor("purple") turtle.setup(800, 400, 200, 200)init()#wuchange(-350, 100)run(0, 100)run(-90, 70)run(180, 100)run(90, 70)change(-350, 0)run(0, 100)change(-400, -50)run(0, 200)change(-30change(-300, 0)run(-90, 50)run(-125, 100)change(-300, -50)run(-55, 100)run(0,10)#fengchange(-65, 70)run(0, 130)change(-50, 10)run(0, 100)change(-100, -70)run(0, 200)change(0, -160)run(90, 280)#yuanchange(125, 100)run(-35, 40)change(125, 25)run(-35, 40)change(125, -125)run(55, 90)change(220, 100)run(0, 110)change(220, 100)run(-95,230)change(285, 85)run(-145, 40)change(250, 65)run(0, 70)run(-90, 80)run(180, 70)run(90, 80)change(250, 25)run(0, 70)change(285,-15)run(-90, 120)run(135, 20)change(250, -50)run(-125, 40)change(315, -50)run(-55, 50)第一次代码的最后一行去掉~ 不完整,接第二次代码希望对您有用喔~祝生活愉快亲~