How to type your own name in python, how to write your own name in python

Hello everyone, the editor is here to answer the following questions for you, how to type your own name in python, how to write your own name in python, let us take a look today!

On this sweet day, I would like to secretly tell you a trick for not preparing a little surprise for the holidays. If you don’t have enough gifts, you can come up with a code.

To express love, a script is enough

First the renderings

Insert image description hereWrite it out one by one and feel good. It’s
a very simple operation to record this special day.

code show as below:

import turtle
from turtle import *

def run(angle, lenth):
    turtle.seth(angle)
    turtle.fd(lenth)

def change(x, y):
    turtle.penup()
    turtle.goto(x, y)
    turtle.pendown()

turtle.setup(1200, 600, 200, 200)
turtle.pensize(10)
turtle.pencolor("black")

change(-550, 100)#将画笔放在坐标A(-550, 80)
run(0, 80)#从A点画到B点
run(-125,160)#从B点画到C点
run(0, 80)#从C点画到D点


change(-400, 100)#将画笔放在坐标A(-550, 80)
run(-90, 150)#从A点画到B点


change(-400, 35)#将画笔放在坐标A(-550, 80)
run(0, 100)#从A点画到B点


change(-300, 100)#将画笔放在坐标A(-550, 80)
run(-90, 150)#从A点画到B点


change(-200, 100)#将画笔放在坐标A(-550, 80)
run(-90, 150)#从A点画到B点
run(0,80)


change(-0, 100)#将画笔放在坐标A(-550, 80)
run(-90, 150)#从A点画到B点
run(0,-80)
run(90,150)
run(0,80)


change(30, 100)#将画笔放在坐标A(30, 100)
run(125, -170)#从A点画到B点
run(75, 150)#从A点画到B点


change(200, 100)#将画笔放在坐标A(200, 100)
run(-90, 160)#从A点画到B点
run(0, 100)#从A点画到B点

change(200, 100)#将画笔放在坐标A(200, 80)
run(0, 100)#从A点画到B点

change(200, 20)#将画笔放在坐标A(-550, 80)
run(0, 100)#从A点画到B点


# 写王字
change(360,100)#将画笔放在坐标A(-100, 80)
run(0, 160)#从A点画到B点

change(360, 20)#将画笔放在坐标A(2100, 80)
run(0, 160)#从A点画到B点


change(360, -60)#将画笔放在坐标A(2100, 80)
run(0, 160)#从A点画到B点

change(450, 100)#将画笔放在坐标E(0, 150)
run(-90, 160)#从E点画到F点


done()

Guess you like

Origin blog.csdn.net/chatgpt001/article/details/132955733