import turtleclassStack:
def __init__(self):
self.items=[]
def isEmpty(self):return len(self.items) == 0def push(self, item):
self.items.append(item)
def pop(self):returnself.items.pop()
def peek(self):ifnot self.isEmpty():return self.items[len(self.items) - 1]
def size(self):returnlen(self.items)
def drawpole_3():#画出汉诺塔的poles
t=turtle.Turtle()
t.hideturtle()
def drawpole_1(k):
t.up()
t.pensize(10)
t.speed(100)
t.goto(400*(k-1), 100)
t.down()
t.goto(400*(k-1), -100)
t.goto(400*(k-1)-20, -100)
t.goto(400*(k-1)+20, -100)
drawpole_1(0)#画出汉诺塔的poles[0]
drawpole_1(1)#画出汉诺塔的poles[1]
drawpole_1(2)#画出汉诺塔的poles[2]
def creat_plates(n):#制造n个盘子
plates=[turtle.Turtle() for i inrange(n)]for i inrange(n):
plates[i].up()