본문 바로가기
프로그램

[파이썬] 터틀로 원 그리기

by 오디세이99 2022. 9. 20.
728x90
반응형

 

import turtle as t
import math

radius = 120
circum = 2 * math.pi * radius           # math package에 있는 pi 사용
area = math.pi * radius * radius

t.setup(width=600,height=600)
t.begin_fill()
t.color('red', 'yellow')
t.shape('turtle')
t.circle(radius)
t.end_fill()
t.done()

728x90
반응형

댓글