본문 바로가기
프로그램

[파이썬] 터틀 골뱅이 그리기

by 오디세이99 2022. 10. 30.
728x90
반응형

 

import turtle as t

t.width(3)
t.pencolor('yellow')
for x in range(1, 240, 5):
    if x % 2 != 0:
        t.pencolor('yellow')
    else:
        t.pencolor('green')
    
    t.forward(x)
    t.left(90)
    
t.done()

728x90
반응형

댓글