|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 石泊远 于 2020-8-1 20:28 编辑
- from turtle import *
- #def
- def gotoa(x,y):
- penup()
- goto(x,y)
- pendown()
- a = int(input('请输入:'))
- #set
- speed(10000000000)
- pensize(3)
- ht()
- begin_poly
- fillcolor('black')
- begin_fill()
- circle(a,180)
- circle(2*a,180)
- circle(a,-180)
- end_fill()
- fillcolor('white')
- begin_fill()
- gotoa(0,3/4*a)
- circle(-a/4,360)
- end_fill()
- fillcolor('black')
- gotoa(0,-2*a)
- setheading(0)
- circle(2*a,180)
- begin_fill()
- gotoa(0,-3/4*a)
- setheading(180)
- circle(a/4,360)
- end_fill()
- end_poly()
- myshape = get_poly()
- register_shape('newshape',myshape) #报错的地方
- clear()
- st()
- shape('myshape')
- while True:
- right(1)
复制代码
第17行漏掉了括号,begin_poly()
第47行拼写错误,shape('newshape')
|
|