python turtle 简易彩虹图

python turtle 简易彩虹图

简易彩虹图python turlte rainbow

简易彩虹图python turlte rainbow

"""
   简易彩虹图
"""
from turtle import *

t = Turtle(shape='turtle')
t.speed(0)

screen =  Screen()
screen.bgcolor("cyan")
screen.title("简易彩虹图")

color_list = ["#FF0000","#FFA600","#FFFF00", "#62FF00",
              "#1E56FC","#4800FF","#CC00FF","#69C5FF"]

diameter=180

t.penup()
t.goto(0,-120)

for color in color_list:
  t.color(color)  
  t.begin_fill()
  t.circle(diameter)
  t.end_fill()
  diameter -= 10
  

 

李兴球

李兴球的博客是Python创意编程原创博客

评论已关闭。