资源预览内容
第1页 / 共18页
第2页 / 共18页
第3页 / 共18页
第4页 / 共18页
第5页 / 共18页
第6页 / 共18页
第7页 / 共18页
第8页 / 共18页
第9页 / 共18页
第10页 / 共18页
亲,该文档总共18页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
1.使用 turtle 库绘制轮廓颜色为红色(red)、填充颜色为粉红色(pink)的心形图形,效果如下图所示。阅读程序框架,补充横线处代码。from turtle import *color(red, _)(_)left(135)fd(100)right(180)circle(50, 180)left(90)circle(50, 180)right(180)fd(100)end_fill()hideturtle()done()输出 参考代码:from turtle import *color(red,pink)begin_fill()left(135)fd(100)right(180)circle(50,-180)left(90)circle(50,-180)right(180)fd(100)end_fill()hideturtle()done()2.使用 turtle 库绘制红色五角星图形,效果如下图所示。阅读程序框架,补充横线处代码。(_)setup(400,400)penup()goto(100,50)pendown()color(red)begin_fill()for i in range(5): forward(200) (_)end_fill()hideturtle()done()输出参考代码:from turtle import *setup(400,400)penup()goto(-100,50)pendown()color(red)begin_fill()for i in range(5): forward(200) right(144)end_fill()hideturtle()done()3. 使用 turtle 库绘制正方形螺旋线,效果如下图所示。阅读程序框架,补充横线处代码。import turtlen = 10for i in ran
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号