python简单应用题(1)

python简单应用题(1)


2024年5月23日发(作者:)

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 库绘制红色五角星图形,效果如下图所示。阅读程序框架,补充横线处

代码。(____①____)

1

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 turtle

n = 10

for i in range(1,10,1):

for j in [90,180,–90,0]:

(____①____)

(____②____)

n += 5

2


发布者:admin,转转请注明出处:http://www.yc00.com/web/1716428084a2727820.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信