python编程乌龟画线_Python技能1 用小海龟(turtle)画了个丑丑小乌龟(附源码)...

使用Python的turtle模块,作者在一小时内绘制了一个简单的小乌龟图形,代码包含乌龟身体和四肢的绘制,以及颜色和形状的设定。
摘要由CSDN通过智能技术生成

看到别人画的小猪佩奇,想起之前画的小乌龟了,就拿你练手了,哈哈

一个小时的成果,有点丑

源码:

#!python 3.8.1

"""画一个小乌龟"""

import turtle as t;

t.pensize(2)

t.hideturtle()

t.colormode(255)

t.color((0,0,0),"Green")

t.setup(500,500)

t.speed(5)

t.penup()

t.goto(0,-100)

t.pendown()

t.circle(100)

t.penup()

t.goto(-20,35)

t.pendown()

t.begin_fill()

t.forward(40)

t.seth(-60)

t.forward(40)

t.seth(-120)

t.forward(40)

t.seth(-180)

t.forward(40)

t.seth(120)

t.forward(40)

t.seth(60)

t.forward(40)

t.end_fill()

t.seth(120)

t.color((0,0,0),(29,184,130))

for i in range(6):

t.begin_fill()

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值