赞
踩
- #import turtle
- from turtle import *
-
-
- # 创建画布和乌龟
- canvas = Screen()
- canvas.bgcolor("white")
- setup(800, 800)
-
- # 画笔的速度
- speed(5)
-
- # 添加文字 北京欢迎您 2021
- penup()
- goto(-400,200)
- pendown()
- write("北京欢迎您 2012", font=("Arial", 60, "normal"))
- # 设置颜色
- color1 = ["blue", "black", "red"]
- color2 = ["yellow", "green"]
-
- # 设置第一次起点坐标
- # start_x = -300
- # start_y = 100
- penup()
- goto(-300,-100)
- pendown()
-
- for i in color1:
- width(10)
- color(i)
- circle(100)
- penup()
- forward(200)
- pendown()
-
- # 设置第二次起点坐标
- penup()
- goto(-200, -200)
- pendown()
-
-
-
- for i in color2:
- width(10)
- color(i)
- circle(100)
- penup()
- forward(200)
- pendown()
-
-
-
- # 隐藏画笔
- hideturtle()
-
- # 显示画布
- canvas.mainloop()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。