파일 다운로드 |
from turtle import * shape("turtle") #눈사람 모양의 원을 그림 circle(30) #1) 반지름,시계방향 circle(-50) #2) 반시계방향 goto(100,100) #3) 해당 좌표로 이동 pensize(10) circle(50) #4) penup() #펜의 자취를 남기지 않음 goto(-100,100) #5) 왼쪽으로 이동 pendown() #펜의 자취를 남 pensize(15) circle(70) #6) sety(-200) #7) Y좌표만 이동 pensize(5) color("blue") circle(30) #8) setx(200) color("red") circle(30) #9) |
파일 다운로드 |
from turtle import * shape("turtle") run=1 while(run==1): pensize(5) goto(0,0) pensize(1) goto(100,100) circle(50) print("명령을 선택하세요.") print("1.Clear") print("2.Reset") vAct=int(input("명령 = ")) if vAct==1: clear() #자취만 삭제 if vAct==2: reset() #위치와 자취 #모두 삭제 |
728x90
'■ 현재-ing > ㅡPython' 카테고리의 다른 글
파이썬 turtle, write, title, onkeypress, up, down, space, left, right (0) | 2020.07.06 |
---|---|
파이썬 점(dot), color 두가지 변수 사용, begin_fill, end_fill (0) | 2020.07.06 |
파이썬 최댓갑과 최솟값 (0) | 2020.07.05 |
파이썬 눈송이 모양 그리기 (0) | 2020.07.05 |
파이썬 거북이 turtle 다각형 그리기 (0) | 2020.07.05 |