渐变的圆

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()

渐变的圆

 

上一篇:python turtle小海龟画图(语法基础及作业案例)


下一篇:History