python中turtle的"Hello world"

楼主正在学python,学到绘图,突然感觉好有意思。。。就想练练手,画了个hello world
纯属娱乐
代码如下

from turtle  import*
pencolor("red")
pensize(10)
up()    # 字母H
goto(-500,100)
seth(-95)
down()
fd(180)
up()
goto(-500,10)
seth(0)
down()
fd(73)
up()
goto(-420,100)
seth(-95)
down()
fd(180)
up()         #字母e
color("grey")
goto(-400,-48)
seth(0)
down()
fd(80)
seth(90)
circle(40,320)
up()        #字母l
color("pink")
goto(-290,100)
seth(-95)
down()
fd(160)
circle(20,160)
up()         #字母l
color("pink")
goto(-240,100)
seth(-95)
down()
fd(160)
circle(20,160)
up()        #字母o
color("yellow")
goto(-200,-50)
seth(-95)
down()
circle(40) 
up()         #字母w
color("brown")
goto(-50,100)
seth(95)
down()
goto(-20,-80)
goto(10,80)
goto(40,-80)
goto(70,100)
up()        # 字母0
color("purple")
goto(75,-50)
seth(-95)
down()
circle(40)
up()       #字母r
color("black")
goto(165,-40)
seth(45)
down()
goto(175,-20)
goto(185,-50)
goto(185,-90)
goto(185,-50)
seth(90)
circle(-25,120)
up()      #字母l
color("green")
goto(240,100)
seth(-95)
down()
fd(160)
circle(20,160)
up()      #字母d
color("blue")
goto(310,-10)
seth(-180)
down()
circle(35,190)
up()
goto(330,100)
seth(-95)
down()
fd(160)
circle(20,130)

没错,就是这么长,,,
运行结果
在这里插入图片描述
这么看其实不直观,自己运行代码才有意思,感觉自己写的代码竟然能绘制图形,哈哈哈

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值