# python123第二周答案_Python123第二周自由练习

#画五角星

import turtle

turtle.pensize(5)

turtle.pencolor("yellow")

turtle.fillcolor("red")

turtle.begin_fill()

for i in range(5):

turtle.forward(120)

turtle.right(144)

turtle.forward(120)

turtle.left(72)

turtle.end_fill()

turtle.hideturtle() #隐藏画笔

turtle.done() #结束绘制

‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‪‬

#画一组同心圆

rmin=eval(input())

number=eval(input())

color=input()

import turtle as t

t.pencolor(color)

t.pensize(4)

for i in range (number):

t.circle(rmin)

rmin=rmin+20

t.penup()

t.seth(-90)

t.fd(20)

t.seth(0)

t.pendown()

t.hideturtle()

t.done()

50

5pink

‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‪‬

‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‪‬

#渐变的圆

import turtle

number = int(input()) #把用户输入转成整数

turtle.screensize(600,500,'white')

turtle.pensize(3) #设置画笔宽度为3

turtle.pencolor('blue') #设置画笔颜色为黑色

turtle.fillcolor('yellow') #设置填充颜色为黄色

turtle.begin_fill() #开始填充

turtle.forward(-50)

for i in range(3,number):

turtle.circle(50, steps=i)

turtle.forward(100)

turtle.circle(50, steps=number)

if number == 1:

turtle.circle(50)

else:

turtle.forward(100)

turtle.circle(50)

turtle.end_fill()

turtle.hideturtle() #隐藏海龟

turtle.done()

9

‪‬‪‬‪‬‪‬‪‬‮‬‪‬‮‬‪‬‪‬‪‬‪‬‪‬‮‬‪‬‭‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‫‬‫‬‪‬‪‬‪‬‪‬‪‬‮‬‭‬‪‬

#画奥运五环

import turtle

coordA=(-100,0,100,-50,70)

coordB=(-20,-20,-20,-70,-70)

turtle.width(5)

turtle.color("red")

turtle.penup()

turtle.goto(coordA[0],coordB[0])

turtle.pendown()

turtle.circle(45)

turtle.color("blue")

turtle.penup()

turtle.goto(coordA[1],coordB[1])

turtle.pendown()

turtle.circle(45)

turtle.color("green")

turtle.penup()

turtle.goto(coordA[2],coordB[2])

turtle.pendown()

turtle.circle(45)

turtle.color("yellow")

turtle.penup()

turtle.goto(coordA[3],coordB[3])

turtle.pendown()

turtle.circle(45)

turtle.color("black")

turtle.penup()

turtle.goto(coordA[4],coordB[4])

turtle.pendown()

turtle.circle(45)

turtle.hideturtle()

turtle.done()

#绘制太极图

from turtle import *

setup(800,800,100,100)

#绘制左半部分

fillcolor('#FFFFFF')

begin_fill()

circle(100,180)

circle(200,180)

seth(180)

circle(-100,180)

end_fill()

seth(90)

penup()

fd(85)

pendown()

seth(0)

fillcolor('#000000')

begin_fill()

circle(25)

end_fill()

seth(-90)

penup()

fd(85)

pendown()

seth(180)

#绘制右半部分

fillcolor('#000000')

begin_fill()

circle(100,180)

circle(200,180)

seth(0)

circle(-100,180)

end_fill()

seth(-90)

penup()

fd(85)

pendown()

seth(-180)

fillcolor('#FFFFFF')

begin_fill()

circle(25)

end_fill()

hideturtle()

done()

• 1
点赞
• 3
收藏
觉得还不错? 一键收藏
• 0
评论
03-30 1万+
11-19 1万+
02-01 421
02-19 1758
11-19 1万+
09-13 8092
07-18 1486
10-20 5万+
08-13 4840

### “相关推荐”对你有帮助么？

• 非常没帮助
• 没帮助
• 一般
• 有帮助
• 非常有帮助

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