import turtle import math turtle.speed(1) def nacrtaj_ntougao(broj_stranica, korak): zbir_unutrasnjih_uglova = (broj_stranica-2)*180 unutrasnji_ugao = zbir_unutrasnjih_uglova / broj_stranica for i in range(broj_stranica): turtle.forward(korak) turtle.left(180-unutrasnji_ugao) korak = 20 for i in range(5): nacrtaj_ntougao(6, korak) turtle.penup() turtle.forward(2*korak) turtle.pendown() turtle.penup() turtle.backward(10*korak) turtle.right(90) turtle.forward(korak*math.sqrt(3)) turtle.left(90) turtle.pendown() for i in range(5): nacrtaj_ntougao(6, korak) turtle.penup() turtle.forward(2*korak) turtle.pendown()