python编程:turtle函数库笔记

python编程:turtle函数库笔记python编程:turtle函数库笔记python编程:turtle函数库笔记python编程:turtle函数库笔记

补充实例:

python编程:turtle函数库笔记

import turtle
 
def main():
    turtle.pensize(3)
    turtle.penup()
    turtle.goto(-200,-50)
    turtle.pendown()
    turtle.begin_fill()
    turtle.color("red")
    turtle.circle(40, steps=3)
    turtle.end_fill()
 
 
    turtle.penup()
    turtle.goto(-100,-50)
    turtle.pendown()
    turtle.begin_fill()
    turtle.color("blue")
    turtle.circle(40, steps=4)
    turtle.end_fill()
 
    turtle.penup()
    turtle.goto(0,-50)
    turtle.pendown()
    turtle.begin_fill()
    turtle.color("green")
    turtle.circle(40, steps=5)
    turtle.end_fill()
 
    turtle.penup()
    turtle.goto(100,-50)
    turtle.pendown()
    turtle.begin_fill()
    turtle.color("yellow")
    turtle.circle(40, steps=6)
    turtle.end_fill()
 
    turtle.penup()
    turtle.goto(200,-50)
    turtle.pendown()
    turtle.begin_fill()
    turtle.color("purple")
    turtle.circle(40)
    turtle.end_fill()
 
    turtle.color("green")
    turtle.penup()
    turtle.goto(-100,50)
    turtle.pendown()
    turtle.write(("Cool Colorful shapes"),
        font = ("Times", 18, "bold"))
    turtle.hideturtle()
 
    turtle.done
 
if __name__ == '__main__':
    main()
上一篇:python编程:合并文本_利用列表或字典将两个通讯录文本合并


下一篇:「CSP-S2019」括号树 题解 (树的遍历,搜索,栈)