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

Upload New File

parent d9181841
No related branches found
No related tags found
No related merge requests found
import turtle as t
t.shape("turtle")
t.pensize(3) #펜 굵기 설정
t.speed(10) #스피드 조정
t.penup() #펜을 들기
k=-200 #처음 x좌표를 -200으로설정
t.goto(k,-50) # -200.-50으로 좌표이동
t.pendown() # 다시 펜을 들어올린다.
t.color("blue")
#이중 for문을 이용하여 도형 여러개 그리기
for i in range(5):
k=k+100 # 도형 하나를 그릴 때마다 x축으로 100씩 평행이동
for j in range(4):
t.forward(60)
t.left(90)
t.penup()
t.goto(k,-50)
t.pendown()
#for 여러개 사용하여 다양한 도형 그리기
t.penup()
t.goto(-200,-200)
t.pendown()
t.begin_fill()
t.color("red")
#삼각형그리기
for i in range(3):
t.forward(60)
t.left(120)
t.end_fill()
t.penup()
t.goto(-100
,-200)
t.pendown()
t.begin_fill()
t.color("green")
#사각형 그리기
for i in range(4):
t.forward(60)
t.left(90)
t.end_fill()
#5각형그리기
t.penup()
t.goto(0,-200)
t.pendown()
t.begin_fill()
t.color("blue")
for i in range(5):
t.forward(40)
t.left(72)
t.end_fill()
#6각형 그리기
t.penup()
t.goto(100,-200)
t.pendown()
t.begin_fill()
t.color("black")
for i in range(6):
t.forward(40)
t.left(60)
t.end_fill()
#원그리기
t.penup()
t.goto(230,-200)
t.pendown()
t.begin_fill()
t.color("orange")
t.circle(40)
t.end_fill()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment