# Bob -画笔与变量名

815 篇文章 0 订阅
22 篇文章 0 订阅
#填充的三角形
import turtle
# turtle.color(color1,color2) # 边的颜色，填充颜色
# turtle.begin_fill()  开始填充
# turtle.end_fill()    结束填充
# bgm 背景音乐 background music
# bgcolor()  背景颜色
turtle.color("blue","pink")
turtle.bgcolor("purple")
turtle.down()
# shape 形状  'turtle'
turtle.shape('turtle')
# speed 速度  1-10 1最慢 10最快  0 超快
# width 宽度  pensize
turtle.pensize(10)
turtle.speed(7)
turtle.begin_fill()
turtle.forward(100)
turtle.left(144)
turtle.forward(100)
turtle.left(144)
turtle.forward(100)
turtle.left(144)
turtle.forward(100)
turtle.left(144)
turtle.forward(100)
turtle.end_fill()
# up抬笔    goto（x,y）过去  forward移动直线   down落笔
turtle.up()
turtle.goto(-100,0)
turtle.color("red","yellow")
turtle.down()
# shape 形状  'turtle'
turtle.shape('turtle')
# speed 速度  1-10 1最慢 10最快  0 超快
turtle.speed(4)
turtle.begin_fill()
turtle.forward(100)
turtle.left(144)
turtle.forward(100)
turtle.left(144)
turtle.forward(100)
turtle.left(144)
turtle.forward(100)
turtle.left(144)
turtle.forward(100)
turtle.end_fill()

turtle.done()


import turtle

# 变量名：
# 1.数字，下划线，字母组成 2.数字不能作为开头，不能有标点符号
# 中文
# 法无禁止即自由
# 见名知义
long = 175
du=  71
turtle.speed(0)
turtle.circle(100,180)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)
turtle.forward(long)
turtle.left(du)

turtle.done()

• 0
点赞
• 0
收藏
• 打赏
• 0
评论
05-10 614
05-08 2249
05-20 204
08-10 6328
02-15 120
01-18 209
03-24 343
01-04 2590
02-02 381
04-25 271

### “相关推荐”对你有帮助么？

• 非常没帮助
• 没帮助
• 一般
• 有帮助
• 非常有帮助

¥2 ¥4 ¥6 ¥10 ¥20

1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、C币套餐、付费专栏及课程。