立4彩正方形.py

立4彩正方形.py

Python简易画立4彩正方形
Python简易画立4彩正方形

Python简易画立4彩正方形

"""
   立4彩正方形.py
"""
import turtle

cs = ['red','orange','yellow','green']
turtle.pensize(5)
turtle.bgcolor('black')

for c in cs:
    turtle.color('magenta',c)
    turtle.begin_fill()
    for _ in range(2):
        turtle.fd(100)
        turtle.left(90)
    turtle.end_fill()
    turtle.left(90)

李兴球

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