import turtle,time t=turtle.Pen() m=0 def top2(): global m m=input('请输入x的值:') try: m=int(m) except: print('请正确输入内容:') time.sleep(0.5) top2() def top1(): f=input('请选择1)forward(x)\n2)left(x)\n3)\right(x)>>>') try: f=int(f) if f==1: top2() t.forward(m) elif f==2: top2() t.left(m) elif f==3: top2() t.right(m) else: assert False except: print('请正确输入内容:') time.sleep(0.5) top1() while True: top1()
初级程序员
by: 云代码会员 发表于:2021-06-16 23:48:57 顶(0) | 踩(0) 回复
zhaodaola
回复评论