# data[].attributes.body
import turtle

def draw_rectangle(x, y, width, height, color):

t.penup()

t.goto(x, y)

t.pendown()

t.begin_fill()

t.fillcolor(color)

for _ in range(2):

t.forward(width)

t.right(90)

t.forward(height)

t.right(90)

t.end_fill()

t = turtle.Turtle()

t.speed(3)

draw_rectangle(-100, 100, 200, 150, "lightgray")

draw_rectangle(-90, 90, 180, 130, "black")

draw_rectangle(-50, -50, 100, 20, "darkgray")

draw_rectangle(-70, -70, 140, 20, "gray")

t.hideturtle()

turtle.done()

컴퓨터 공학과를 가고 싶어서 컴퓨터와 관련된 모니터를 직사각형의 형태로 그렸다

# data[].attributes.body
import turtle

t=turtle.turtle()

t.color('yellow')

def f():

t.forward(100)

t.left(60)

def h():

f(), f(), f(), f(), f(), f()

def g():

h()

t.forward(100)

t.right(60)

g(), g(), g(), g(), g(), g()

turtle.exitonclick()

# data[].attributes.body
import turtle

pen = turtle.Turtle()

pen.shape("turtle")

pen.speed(3)

pen.penup()

pen.goto(0, -50)

pen.pendown()

pen.begin_fill()

pen.color("yellow")

pen.circle(50)

pen.end_fill()

pen.penup()

pen.goto(-20, 10)

pen.pendown()

pen.begin_fill()

pen.color("black")

pen.circle(5)

pen.end_fill()

pen.penup()

pen.goto(20, 10)

pen.pendown()

pen.begin_fill()

pen.color("black")

pen.circle(5)

pen.end_fill()

pen.penup()

pen.goto(0, -10)

pen.pendown()

pen.begin_fill()

pen.color("orange")

pen.setheading(-30)

for _ in range(3):

pen.forward(15)

pen.left(120)

pen.end_fill()

pen.hideturtle()

turtle.done()

# data[].attributes.body
import turtle

t = turtle.Turtle()

t.shape("turtle")

t.speed(0)

def f(x):

return x ** 2 + 1

t.goto(200, 0)

t.goto(0, 0)

t.goto(0, 200)

t.goto(0, 0)

for x in range(150):

t.goto(x, int(0.01 * f(x)))

turtle.done()

이차함수의 성질을 이용하여 이차함수, 포물선 곡선을 표현하고 싶었다.

# data[].attributes.body
현미경 그리기

import turtle

screen = turtle.Screen()

screen.bgcolor("white")

t = turtle.Turtle()

t.speed(3)

def draw_microscope():

t.penup()

t.setposition(-50, -100)

t.pendown()

t.color("black")

t.begin_fill()

for _ in range(2):

t.forward(100)

t.left(90)

t.forward(150)

t.left(90)

t.end_fill()

t.penup()

t.setposition(-25, -100)

t.pendown()

t.color("gray")

t.begin_fill()

for _ in range(2):

t.forward(50)

t.left(90)

t.forward(25)

t.left(90)

t.end_fill()

t.penup()

t.setposition(0, 50)

t.pendown()

t.color("blue")

t.begin_fill()

t.circle(30)

t.end_fill()

draw_microscope()

turtle.done()

# data[].attributes.body
import turtle

def dna():

t = turtle.Turtle()

t.speed(5)

for i in range(10):

t.penup()

t.goto(-200 + i * 40, 30)

t.pendown()

t.circle(10)

t.penup()

t.goto(-200 + i * 40, -30)

t.pendown()

t.circle(10)

t.penup()

t.goto(-200 + i * 40, 30)

t.pendown()

t.goto(-200 + i * 40, -30)

t.hideturtle()

dna()

import turtle

import math

def wave():

t = turtle.Turtle()

t.speed(5)

t.penup()

t.goto(-300, 0)

t.pendown()

t.color("blue")

for x in range(-300, 300, 10):

y = 50 * math.sin(math.radians(x))

t.goto(x, y)

t.hideturtle()

turtle.done()

wave()

# data[].attributes.body
import turtle

t=turtle.Turtle()

t.shape('turtle')

def f(x):

return x**2+1

t.goto(200,0)

t.goto(-200,0)

t.goto(0,0)

t.goto(0,200)

t.goto(0,-200)

t.goto(0,0)

t.penup()

t.goto(-150,int(0.01*f(-150)))

t.pendown()

for x in range(-150,151,1):

t.goto(x, int(0.01*f(x)))

from turtle import *

import math

a=int(input('x^2의계수를 입력하세요 : '))

b=int(input('x의 계수를 입력하세요 : '))

c=int(input('상수항을 입력하세요 : '))

d=b**2-4*a*c

if d>0:

x1=((-b+math.sqrt(d)/2*a))

x2=((-b-math.sqrt(d)/2*a))

print('첫번째 근 : ',x1)

print('두번째 근 : ',x2)

print('첫번째 근 : ','(',-b,'+','√'d,') ,'/',2*a)

print('두번째 근 : ','(',-b,'-','√'d,') ,'/',2*a)

if d<0:

x1=((-b+math.sqrt(-d)/2*a))

x2=((-b-math.sqrt(-d)/2*a))

print('첫번째 근 : ',x1)

print('두번째 근 : ',x2)

print('첫번째 근 : ','(',-b,'+','√'d,'i',')','/',2*a)

print('두번째 근 : ','(',-b,'-','√'d,'i',')','/',2*a)

if d=0:

x1=(-b)/2*a

print('중근 :',x1)

title('이차함수 그리기')

y=Turtle()

y.goto(0, -200)

y.goto(0,200)

y.setheading(90)

y.write('y')

x=Turtle()

x.goto(0, -200)

x.goto(0,200)

x.setheading(90)

x.write('x')

o=Turtle()

o.penup

o.hideturtle()

o.goto(0,0)

o.write('0')

pen=Turtle()

pen.penup()

pen.goto(-50,0)

pen.pensize(1)

xcor=-50

while xcor<=50:

ycor=(a*(xcor**2))+(b*xcor)+c

pen.goto(xcor, ycor)

pen.pendown()

xcor +=0.5

# data[].attributes.body
import turtle def draw_rectangle(x, y, width, height, color): t.penup() t.goto(x, y) t.pendown() t.begin_fill() t.fillcolor(color) for in range(2): t.forward(width) t.right(90) t.forward(height) t.right(90) t.endfill() def draw_line(x, y, length, angle): t.penup() t.goto(x, y) t.setheading(angle) t.pendown() t.forward(length) t = turtle.Turtle() t.speed(3) draw_rectangle(-30, 100, 60, 200, "lightgray") draw_rectangle(-10, 300, 20, 40, "gray") draw_rectangle(-25, 150, 50, 120, "blue") draw_rectangle(-70, 310, 140, 10, "darkgray") draw_rectangle(-5, -100, 10, 100, "silver") draw_line(0, -100, 20, -90) t.hideturtle() turtle.done()

# data[].attributes.body
#임포트 세팅

from turtle import *

import math

#입력

a=int(input('x^2의 계수를 입력하세요 : '))

b=int(input('x의 계수를 입력하세요 : '))

c=int(input('상수항을 입력하세요 : '))

color=int(input('색상을 입력하세요(영어) :'))

#판별식

d=b**2-4*a*c

#판별식 >0 -서로 다른 두 실근

if d>0:

x1=((-b+math.sqrt(d))/2*a)

x2=((-b-math.sqrt(d))/2*a)

print('첫번째 근 :',x1)

print('두번째 근 :',x2)

print('첫번쨰 근','(',-d,'+','루트',d,'i',')','/',2*a)

print('첫번쨰 근','(',-d,'+','루트',d,'i',')','/',2*a)

#판별식 =0-중근

if d==0:

x1=(-b)/2*a

print('중근 : ',x1)

#판별식 <0-허근

if d==0:

x1r=((-b+math.sqrt(-d))/2*a)

x2r=((-b-math.sqrt(-d))/2*a)

print('첫번째 근 :',x1r)

print('두번째 근 :',x2r)

print('첫번쨰 근','(',-d,'+','루트',d,'i',')','/',2*a)

print('첫번쨰 근','(',-d,'+','루트',d,'i',')','/',2*a)

#타이틀

print('이차함수 그리기')

#y축

y=Turtle()

y.shape(tirtle)

y.goto(0,-200)

y.goto(0,200)

y.setheading(90)

y.write('y')

#x축

x=Turtle()

x.shape(tirtle)

x.goto(-200,0)

x.goto(200,0)

x.setheading(90)

x.write('x')

#원점

o=Turtle()

o.shape(tirtle)

o.penup()

o.hideturtle()

o.goto(0,0)

o.write('o')

#그래프

pen=Turtle()

pen.pencolor(color)

pen.shape(tirtle)

pen.speed(5)

pen.penup()

pen.goto(-50,0)

pen.pensize(1)

#초기x값 설정

xcor=-50

#그래프 그리기

while xcor<=50:

ycor=(a*(xcor**2)+(b*xcor)+c)

pen.goto(xcor,ycor)

pen.pendown()

xcor+=0.5

pen.write(f'{a}x^2+{b}x+c')

# data[].attributes.body
import turtle

t=turtle.Pen()

t.color('blue')

t.speed(10)

t.pendown()

t.begin_fill()

t.circle(80)

t.end_fill()

t.up()

t.forward(150)

t.down()

t.begin_fill()

t.circle(80)

t.end_fill()

t.up()

t.forward(150)

t.down()

t.begin_fill()

t.circle(80)

t.end_fill()

t.up()

# data[].attributes.body
import turtle # 화면 설정 turtle.bgcolor("black") # 배경색을 검은색으로 설정 turtle.speed(3) # 그리기 속도 설정 # 로봇 몸체 def draw_body(): turtle.penup() turtle.goto(-50, -100) turtle.pendown() turtle.color("gray") turtle.begin_fill() turtle.forward(100) # 몸체 너비 turtle.left(90) turtle.forward(150) # 몸체 높이 turtle.left(90) turtle.forward(100) # 몸체 너비 turtle.left(90) turtle.forward(150) # 몸체 높이 turtle.end_fill() # 로봇 얼굴 def draw_face(): turtle.penup() turtle.goto(-30, 0) turtle.pendown() turtle.color("lightblue") turtle.begin_fill() turtle.circle(30) # 얼굴 크기 turtle.end_fill() # 눈 turtle.penup() turtle.goto(-20, 10) turtle.pendown() turtle.color("white") turtle.begin_fill() turtle.circle(5) # 왼쪽 눈 turtle.end_fill() turtle.penup() turtle.goto(10, 10) turtle.pendown() turtle.begin_fill() turtle.circle(5) # 오른쪽 눈 turtle.end_fill() # 입 turtle.penup() turtle.goto(-15, -5) turtle.pendown() turtle.color("black") turtle.setheading(-60) # 입 모양 각도 turtle.circle(15, 120) # 입 그리기 # 로봇 그리기 draw_body() draw_face() # 완료 후 대기 turtle.hideturtle() # 거북이 숨기기 turtle.done() # 그리기 완료

# data[].attributes.body
import turtle

t=turtle.Pen()

t.screen.bgcolor('orange')

t.color('red')

t.shape('classic')

t.forward(100)

t.left(90)

t.forward(100)

t.left(90)

t.forward(100)

t.left(90)

t.forward(100)

t.left(90)

t.forward(100)

t.left(90)

t.forward(99)

t.left(90)

t.forward(99)

t.left(90)

t.forward(98)

t.left(90)

t.forward(98)

t.left(90)

t.forward(98)

t.left(90)

의료나 보건 학과를 가고 싶어서 피부색과 유사한 주황색을 바탕화면으로, 예리한 나이프를 표현하기 위한 작고 얇은 커서인 클래식 커서, 피부를 절개하면 나오는 피를 커서 색상을 빨간색으로 설정하여 표현하였다.

# data[].attributes.body
import turtle

import turtle as t

t.forward(100)

t.left(144)

t.forward(100)

t.left(144)

t.forward(100)

t.left(144)

t.forward(100)

t.left(144)

t.forward(100)

t.left(144)

# data[].attributes.body
함수 계산

'''import turtle

t=turtle.Turtle()

t.shape('turtle')

def f(x):

return x**2+1

t.goto(200,0)

t.goto(0,0)

t.goto(0,200)

t.goto(0,0)

for x in range(150):

t.goto(x, int(0.01*f(x)))'''

from turtle import *

import math

a=int(input('x^2의 계수를 입력하세요 : '))

b=int(input('x의 계수를 입력하세요 : '))

c=int(input('상수항을 입력하세요 : '))

d=(b**2)-4*a*c

if d>0:

x1=((-b+math.sqrt(d))/2*a)

x2=((-b-math.sqrt(d))/2*a)

print('첫번째 근 :', x1)

print('두번째 근 :', x2)

print('첫번째 근 :', '(', -b, '+', '√', d, 'i',')', '/', 2*a)

print('두번째 근 :', '(', -b, '-', '√', d, 'i',')', '/', 2*a)

if d==0:

x1=(-b)/2*a

print('중근 :', x1)

if d<0:

x1r=((-b+math.sqrt(-d))/2*a)

x2r=((-b-math.sqrt(-d))/2*a)

print('첫번째 근 :', x1r, 'i')

print('두번째 근 :', x2r, 'i')

print('첫번째 근 :', '(', -b, '+', '√', d, 'i',')', '/', 2*a)

print('두번째 근 :', '(', -b, '-', '√', d, 'i',')', '/', 2*a)

title('이차함수 그리기')

y=Turtle()

y.goto(0,-200)

y.goto(0,200)

y.setheading(90)

y.write('y')

x=Turtle()

x.goto(-200,0)

x.goto(200,0)

x.write('x')

o=Turtle()

o.penup()

o.hideturtle()

o.goto(0,0)

o.write('0')

pen=Turtle()

pen.penup()

pen.goto(-50,0)

pen.pensize(1)

int(xcor)==-50

while xcor <= 50:

ycor=(a*(xcor**2))+(b*xcor)+c

pen.goto(xcor,ycor)

pen.pendown()

xcor==0.5

# data[].attributes.body
import turtle

t = turtle.Turtle()

t.penup()

t.forward(120)

t.pendown()

t.circle(100)

t.penup()

t.backward(160)

t.pendown()

t.circle(100)

t.penup()

t.right(90)

t.forward(100)

t.circle(140)

t.right(90)

t.forward(100)

# data[].attributes.body
import turtle as t

t.shape('turtle')

t.bgcolor('black')

t.pencolor('white')

t.speed(10)

t.forward(20)

t.left(60)

t.forward(15)

t.left(300)

t.forward(15)

t.left(180)

t.forward(15)

t.left(60)

t.forward(15)

t.left(60)

t.forward(15)

t.left(60)

t.forward(15)

t.left(180)

t.forward(15)

t.left(300)

t.forward(15)

t.left(240)

t.shape('turtle')

t.bgcolor('black')

t.pencolor('white')

t.forward(25)

t.left(60)

t.forward(20)

t.left(300)

t.forward(20)

t.left(180)

t.forward(20)

t.left(60)

t.forward(20)

t.left(60)

t.forward(20)

t.left(60)

t.forward(20)

t.left(180)

t.forward(20)

t.left(300)

t.forward(20)

t.left(240)

t.shape('turtle')

t.bgcolor('black')

t.pencolor('white')

t.forward(30)

t.left(60)

t.forward(25)

t.left(300)

t.forward(25)

t.left(180)

t.forward(25)

t.left(60)

t.forward(25)

t.left(60)

t.forward(25)

t.left(60)

t.forward(25)

t.left(180)

t.forward(25)

t.left(300)

t.forward(25)

t.left(240)

t.shape('turtle')

t.bgcolor('black')

t.pencolor('white')

t.forward(35)

t.left(60)

t.forward(30)

t.left(300)

t.forward(30)

t.left(180)

t.forward(30)

t.left(60)

t.forward(30)

t.left(60)

t.forward(30)

t.left(60)

t.forward(30)

t.left(180)

t.forward(30)

t.left(300)

t.forward(30)

t.left(240)

t.shape('turtle')

t.bgcolor('black')

t.pencolor('white')

t.forward(35)

t.left(60)

t.forward(40)

t.left(300)

t.forward(40)

t.left(300)

t.forward(40)

t.left(300)

t.forward(40)

t.left(300)

t.forward(40)

t.left(300)

t.forward(40)

t.left(60)

t.forward(135)

t.left(240)

# data[].attributes.body
def draw_rectangle(width, height):

"""

width: 가로 길이 (공연장의 폭)

height: 세로 길이 (공연장의 높이)

"""

for _ in range(height):

print("#" * width) # 가로 길이에 맞게 #을 출력

# 사용자 입력 받기

try:

print("직사각형 공연장 크기를 입력하세요.")

width = int(input("가로 길이 (숫자): "))

height = int(input("세로 길이 (숫자): "))

if width <= 0 or height <= 0:

print("가로와 세로 길이는 양의 정수여야 합니다.")

else:

print("\n직사각형 공연장 모양:")

draw_rectangle(width, height)

except ValueError:

print("숫자만 입력해주세요!")

# data[].attributes.body
import turtle

screen = turtle.Screen()

screen.bgcolor("white")

bottle = turtle.Turtle()

bottle.speed(5)

def draw_bottle_body():

bottle.penup()

bottle.goto(-50, -100)

bottle.pendown()

bottle.begin_fill()

bottle.color("lightblue")

for _ in range(2):

bottle.forward(100)

bottle.left(90)

bottle.forward(200)

bottle.left(90)

bottle.end_fill()

def draw_cap():

bottle.penup()

bottle.goto(-50, 100)

bottle.pendown()

bottle.begin_fill()

bottle.color("darkblue")

for _ in range(2):

bottle.forward(100)

bottle.left(90)

bottle.forward(20)

bottle.left(90)

bottle.end_fill()

def draw_label():

bottle.penup()

bottle.goto(-40, 20)

bottle.pendown()

bottle.color("white")

bottle.begin_fill()

for _ in range(2):

bottle.forward(80)

bottle.left(90)

bottle.forward(50)

bottle.left(90)

bottle.end_fill()

def draw_bottle():

draw_bottle_body()

draw_cap()

draw_label()

def draw_small_circle():

bottle.penup()

bottle.goto(150, 0)

bottle.pendown()

bottle.begin_fill()

bottle.color("blue")

bottle.circle(30)

bottle.end_fill()

draw_bottle()

draw_small_circle()

screen.exitonclick()

# data[].attributes.body
import turtle

screen = turtle.Screen()

screen.setup(800, 600)

screen.bgcolor("white")

pen = turtle.Turtle()

pen.speed(5)

def draw_circle(radius, color, x, y):

pen.penup()

pen.goto(x, y - radius)

pen.pendown()

pen.begin_fill()

pen.color(color)

pen.circle(radius)

pen.end_fill()

def draw_continents():

pen.penup()

pen.goto(-50, 50)

pen.pendown()

pen.begin_fill()

pen.color("green")

pen.circle(30)

pen.end_fill()

pen.penup()

pen.goto(80, -100)

pen.pendown()

pen.begin_fill()

pen.color("green")

pen.circle(40)

pen.end_fill()

def draw_earth():

radius = 150

draw_circle(radius, "blue", 0, 0)

draw_continents()

pen.hideturtle()

draw_earth()

screen.exitonclick()

# data[].attributes.body
import turtle

t=turtle.Turtle()

t.shape('turtle')

radius = int(input('원의 반지름을 입력하세요 :'))

t.color('yellow')

t.begin_fill()

t.circle(radius)

t.end_fill()

turtle.exitonclick()

# data[].attributes.body
#임포트 세팅

from turtle import *

import math

# 1. 일단 x^2의 계수, x의 계수, 상수항을 입력받는다.

#입력

a = int(input("x^2의 계수를 입력하세요 : "))

b = int(input("x의 계수를 입력하세요 : "))

c = int(input("상수항을 입력하세요 : "))

# 2. x, y축 원점을 그린다.

#y축

y = Turtle()

y.goto(0, -200)

y.goto(0, 200)

y.setheading(90)

y.write("y")

#x축

x = Turtle()

x.goto(-200, 0)

x.goto(200, 0)

x.write("x")

#원점

o = Turtle()

o.penup()

o.hideturtle()

o.goto(0, 0)

o.write("O")

# 3. x값의 범위를 설정하고, 맨 끝 범위의 맞는 좌표로 보낸다.

#초기 x값 설정

xcor = -50

ycor = (a*(xcor**2)) + (b*xcor) + c

#그래프

pen = Turtle()

pen.pensize(1)

pen.penup()

pen.goto(xcor, ycor )

pen.pendown()

# 4. x값을 변화시키면서 (x, y)의 좌표로 터틀을 보낸다.

#그래프 그리기

while xcor<=50:

ycor = (a*(xcor**2)) + (b*xcor) + c

pen.goto(xcor, ycor)

xcor += 0.5

# data[].attributes.body
import turtle

t=turtle.Turtle()

#얼굴

t.penup()

t.goto(0, -100) #얼굴위치 조정

t.pendown()

t.circle(100)

#눈

t.penup()

t.goto(-35, 30)

t.pendown()

t.circle(10)

t.penup()

t.goto(35, 30)

t.pendown()

t.circle(10)

#입

t.penup()

t.goto(-40, -20)

t.pendown()

t.right(90)

t.circle(40, 180)

t.hideturtle()

turtle.done()

진로가 메이크업 쪽이라서 사람 얼굴을 그려 표현해보았디.