小猪佩奇里的云朵太阳(turtle绘图 第七周Python小组作业分享)

文章介绍了使用Python的turtle库绘制蓝天、绿地和云朵图形的过程,是基于已有代码的修改,并非原创。下期预告将有更多编程教学内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

3349cfb72f14452fb39ec7c21050ba51.jpg

为了方便显示加上了蓝天绿地

蓝天绿地在上期代码分享中(。-ω-)✧*。

开始喽

#太阳

import turtle as  t

t.setup(1200,800,150,0)

t.pensize(10)

t.colormode(255)

t.penup()

t.goto(480,300)

t.pendown()

t.begin_fill()

t.color(255,255,135)

t.fillcolor(255,255,135)

t.circle(20)

t.end_fill()

t.penup()

t.goto(480,280)

for i in range(9):

       t.up()

       t.circle(40,40)

       t.down()

       t.right(90)

       t.forward(10)

       t.backward(10)

       t.left(90)

#云朵左

import turtle as t

t.colormode(255)

t.penup()

t.goto(-550,350)

t.begin_fill()

t.left(150)

t.pendown()

t.pencolor("white")

t.circle(10,120)

t.right(60)

t.circle(8,150)

t.right(80)

t.circle(12,120)

t.right(50)

t.circle(9,100)

t.right(80)

t.circle(9,120)

t.right(70)

t.circle(10,180)

t.right(130)

t.circle(4,180)

t.color("white")

t.end_fill()

#云朵中

t.left(60)

t.colormode(255)

t.penup()

t.goto(-69,350)

t.begin_fill()

t.left(150)

t.pendown()

t.pencolor("white")

t.circle(50,120)

t.right(60)

t.circle(30,150)

t.right(80)

t.circle(30,120)

t.right(50)

t.circle(60,60)

t.right(80)

t.circle(40,120)

t.right(60)

t.circle(30,150)

t.right(100)

t.circle(42,200)

t.color("white")

t.end_fill()

#云朵右

t.left(90)

t.colormode(255)

t.penup()

t.goto(150,380)

t.begin_fill()

t.left(150)

t.pendown()

t.pencolor("white")

t.circle(50,190)

t.right(60)

t.circle(45,120)

t.right(80)

t.circle(50,120)

t.right(60)

t.circle(55,140)

t.right(20)

t.circle(60,80)

t.right(30)

t.circle(50,40)

t.color("white")

t.end_fill()

下期预告:猪佩琪d4c5160314884b69b24a7d786bfe43d2.jpg

 (但是是对网上已有的代码进行改正后的,非原创,希望各位多多包涵(/_\) )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值