import turtle as t
def draw_shape(length, shape, depth):
if depth == 0:
return
for x in range(shape):
draw_shape(length/2, shape, depth-1)
t.forward(length)
t.left(360/shape)
def main():
t.speed(0)
t.penup()
t.goto(-200,-100)
t.pendown()
draw_shape(512, 3, 7)
t.exitonclick()
if __name__ == '__main__':
main()
'Coding > Python 삽질기' 카테고리의 다른 글
| AI로 근무 시간 짜주는 스크립트 만들어 보기 (0) | 2025.02.27 |
|---|---|
| [Python] Jupyter notebook 팁 (0) | 2024.05.11 |
| [SQL] BEGIN TRANSACTION (0) | 2024.03.07 |