Код: Выделить всё
def drawOctagon(side):
count = 0
while count < 8:
c.forward(side)
c.right(45)
count += 1
Код: Выделить всё
def drawShapes():
c.penup()
c.setpos(100.0, 100.0)
c.pendown()
random.seed()
numOct = random.randint(5, 11)
length = 50
while numOct > 0:
drawOctagon(length)
c.penup()
c.forward(10)
c.pendown()
numOct -= 1
Подробнее здесь: https://stackoverflow.com/questions/680 ... d-function
Мобильная версия