知识屋:更实用的电脑技术知识网站
所在位置:首页 > 科技

python编程代码画哆啦A梦

发表时间:2022-03-24来源:网络

2019PHP高薪工程师学习路线图....>>>


这是初学python时画的,当时还没有面向对象的概念,也没有采取类方法之类,纯原始手工,供大家参考。

画出来的效果如下图:

代码如下:

# * -- utf-8 -- *
# Author: Tang
 
import turtle as t
 
t.speed(10)
t.pensize(8)
t.hideturtle()
t.screensize(500, 500, bg='white')
 
# 猫脸
t.fillcolor('#00A1E8')
t.begin_fill()
t.circle(120)
t.end_fill()
 
t.pensize(3)
t.fillcolor('white')
t.begin_fill()
t.circle(100)
t.end_fill()
 
t.pu()
t.home()
t.goto(0, 134)
t.pd()
t.pensize(4)
t.fillcolor("#EA0014")
t.begin_fill()
t.circle(18)
t.end_fill()
 
t.pu()
t.goto(7, 155)
t.pensize(2)
t.color('white', 'white')
t.pd()
t.begin_fill()
t.circle(4)
t.end_fill()
 
t.pu()
t.goto(-30, 160)
t.pensize(4)
t.pd()
t.color('black', 'white')
t.begin_fill()
a = 0.4
for i in range(120):
    if 0

收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜