Skip to content
Snippets Groups Projects
Commit 8a311d22 authored by Minseong Kwon's avatar Minseong Kwon
Browse files

Upload New File

parent 831d0259
No related branches found
No related tags found
No related merge requests found
import turtle as t
#거북이 모양으로 변경하기
t.shape("turtle")
#삼각형그리기
#100만큼 앞으로 이동
t.forward(100)
#왼쪽방향으로 120도 만큼 회전한다
t.left(120)
#다시 앞으로 100만큼 이동한다
t.forward(100)
t.left(120)
t.forward(100)
#원그리기
#펜을 들기
t.penup()
#포지션 재설정하기
t.setposition(-100,-100)
#다시 펜을 내린다
t.pendown()
t.circle(50)
#사각형그리기
t.penup()
t.setposition(200,0)
t.pendown()
t.color("blue") #펜 색깔을 파란색으로 변경
t.pensize(5) #펜 굵기를 5로 변경
for i in range(4): #아래 로직을 4번 반복
t.forward(100) #거북이가 100만큼 앞으로 이동
t.left(90)
#오각형그리기
n=5
t.color("purple") #색을 보라색으로 지정
t.begin_fill() #색칠 영역시작
for x in range(n):
t.forward(50)
t.left(360/n)
t.end_fill() #색칠할 영역 마무리
t.hideturtle() #거북이를 숨긴다
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment