파이썬으로 태극기 만들기
- 최초 등록일
- 2019.12.31
- 최종 저작일
- 2019.10
- 7페이지/ 한컴오피스
- 가격 1,500원
소개글
"파이썬으로 태극기 만들기"에 대한 내용입니다.
목차
1. 태극기 그리는 소스 코드
2. 결과 화면
본문내용
-태극기 그리는 소스 코드
import turtle
x=int(input("가로길이를 입력하세요:"))
t=turtle.Turtle()
y=(x/3)*2
R=y/2
r=R/2
t.speed(0)
t.width(1)
t.up()
t.goto(-(x/2),y/2)
t.down()
t.fd(x)
t.right(90)
t.fd(y)
t.right(90)
t.fd(x)
t.right(90)
t.fd(y)
t.right(90)
t.up()
t.goto(0,0)
t.down()
def draw_shape(radius,color1):
t.left(270)
t.color("black",color1)
t.begin_fill()
t.circle(radius/2.0,-180)
t.circle(radius,180)
t.left(180)
t.circle(-radius/2.0,-180)
t.end_fill()
def long():
t.begin_fill()
t.color("black")
참고 자료
없음