Untitled

mail@pastecode.io avatarunknown
plain_text
a month ago
3.1 kB
1
Indexable
Never
import turtle

win = turtle.Screen()
win.title("#ZDINTERNS23")
win.bgcolor("light blue")

turta = turtle.Turtle()  # I gave the name turta for my turtle
turta.color("black")  # make turta black (default color)
turta.pensize(4)  # set the width of turta as 4
turta.speed(1)  # Set the drawing speed to see the process clearly

# Define a function to draw each letter
def draw_letter(letter):
    if letter == 'Z':
        turta.forward(70)
        turta.right(135)
        turta.forward(100)
        turta.left(135)
        turta.forward(70)
        turta.penup()
        turta.left(90)
        turta.forward(100)
        turta.left(90)
        turta.forward(25)
        turta.pendown()
    elif letter == 'D':
        turta.right(135)
        turta.forward(100)
        turta.right(45)
        turta.forward(30)
        turta.right(45)
        turta.forward(100)
        turta.left(180)
        turta.penup()
        turta.forward(30)
        turta.pendown()
    elif letter == 'I':
        turta.forward(70)
    elif letter == 'N':
        turta.left(90)
        turta.forward(70)
        turta.right(135)
        turta.forward(100)
        turta.left(135)
        turta.forward(70)
        turta.penup()
        turta.left(90)
        turta.forward(100)
        turta.left(90)
        turta.forward(25)
        turta.pendown()
    elif letter == 'T':
        turta.right(90)
        turta.forward(70)
        turta.left(90)
        turta.forward(35)
        turta.left(90)
        turta.forward(70)
    elif letter == 'E':
        turta.forward(70)
        turta.right(90)
        turta.forward(35)
        turta.penup()
        turta.goto(turta.xcor(), turta.ycor() + 35)
        turta.pendown()
        turta.forward(35)
        turta.penup()
        turta.goto(turta.xcor(), turta.ycor() - 35)
        turta.pendown()
        turta.forward(35)
    elif letter == 'R':
        turta.right(90)
        turta.forward(35)
        turta.goto(turta.xcor(), turta.ycor() + 35)
        turta.right(135)
        for i in range(20):
            turta.right(15)
            turta.forward(6)
        turta.left(180)
        turta.forward(60)
        turta.penup()
        turta.goto(turta.xcor(), turta.ycor() - 60)
        turta.pendown()
    elif letter == 'S':
        turta.forward(35)
        turta.left(90)
        turta.forward(35)
        turta.left(90)
        turta.forward(35)
        turta.right(90)
        turta.forward(35)
        turta.right(90)
        turta.forward(35)
    elif letter == '2':
        turta.left(90)
        turta.forward(35)
        turta.right(90)
        turta.forward(25)
        turta.right(90)
        turta.forward(35)
    elif letter == '3':
        turta.forward(30)
        turta.left(135)
        turta.forward(45)
        turta.right(135)
        turta.forward(30)
        turta.left(135)
        turta.forward(45)

# Set the starting position for the letters
turta.penup()
turta.goto(-350, 0)
turta.pendown()

# Letters in "#ZDINTERNS23"
letters = "#ZDINTERNS23"

for letter in letters:
    draw_letter(letter)
    
turtle.done()