Netflix Logo using Python Turtle

Written by Omar Moustafa on May 13th, 2022 Views Report Post

Starting a completely awesome series of creating logos using:

Python Turtle

We will be starting with Netflix because it is an exciting logo!

Coding

First, install turtle, use the command pip install turtle...

We'll start by setting up Turtle:

import turtle # here we imported turtle

t = turtle.Turtle() # define our turtle
turtle.Screen().bgcolor('black') # set background color to black

Now, we will make the 2 lines on the right and left, we should get a result like the following image:

Alt text

pos = [(-40,0),(40,0)] # define our positions cords
for x,y in pos: # for each position
    t.up() # lift pen
    t.goto(x,y) # move to position
    t.down() # put pen down
    t.color('red') # set color to red
    t.begin_fill() # begin filling
    for i in range(2): # for each side
        t.forward(200) # move forward 200 pixels
        t.left(90) # turn left 90 degrees
        t.forward(40) # move forward 40 pixels
        t.left(90) # turn left 90 degrees
    t.end_fill() # end filling
t.up() # lift pen

We will now finish the logo:

import turtle # here we imported turtle

t = turtle.Turtle() # define our turtle
turtle.Screen().bgcolor('black') # set background color to black

t.right(90) # turn turtle to face up by (90)

pos = [(-40,0),(40,0)] # define our positions cords
for x,y in pos: # for each position
    t.up() # lift pen
    t.goto(x,y) # move to position
    t.down() # put pen down
    t.color('red') # set color to red
    t.begin_fill() # begin filling
    for i in range(2): # for each side
        t.forward(200) # move forward 200 pixels
        t.left(90) # turn left 90 degrees
        t.forward(40) # move forward 40 pixels
        t.left(90) # turn left 90 degrees
    t.end_fill() # end filling
t.up() # lift pen  

t.goto(-40,0) # go to position
t.down() # put pen down
t.left(22) # turn left 22 degrees
t.begin_fill() # begin filling
for i in range(2): # for each side
    t.forward(217) # move forward 217 pixels
    t.left(68) # turn left 68 degrees
    t.forward(40) # move forward 40 pixels
    t.left(112) # turn left 112 degrees
t.end_fill() # end filling

input() # wait for user to press enter to exit

But as you can see, it is not exactly like the real logo, so this is a better code to get better result:

import turtle
from time import sleep

t = turtle.Turtle()
t.speed(4)
turtle.bgcolor("white")
t.color("white")
turtle.title('Netflix Logo')

t.up()
t.goto(-80, 50)
t.down()
t.fillcolor("black")
t.begin_fill()

t.forward(200)
t.setheading(270)
s = 360
for i in range(9):
    s = s - 10
    t.setheading(s)
    t.forward(10)

t.forward(180)
s = 270
for i in range(9):
    s = s - 10
    t.setheading(s)
    t.forward(10)

t.forward(200)
s = 180
for i in range(9):
    s = s - 10
    t.setheading(s)
    t.forward(10)

t.forward(180)
s = 90
for i in range(9):
    s = s - 10
    t.setheading(s)
    t.forward(10)
t.forward(30)
t.end_fill()

t.up()
t.color("black")
t.setheading(270)
t.forward(240)
t.setheading(0)
t.down()
t.color("red")
t.fillcolor("#E50914")
t.begin_fill()
t.forward(30)
t.setheading(90)
t.forward(180)
t.setheading(180)
t.forward(30)
t.setheading(270)
t.forward(180)
t.end_fill()
t.setheading(0)
t.up()
t.forward(75)
t.down()
t.color("red")
t.fillcolor("#E50914")
t.begin_fill()
t.forward(30)
t.setheading(90)
t.forward(180)
t.setheading(180)
t.forward(30)
t.setheading(270)
t.forward(180)
t.end_fill()
t.color("red")
t.fillcolor("red")
t.begin_fill()
t.setheading(113)
t.forward(195)
t.setheading(0)
t.forward(31)
t.setheading(293)
t.forward(196)
t.end_fill()
t.hideturtle()

sleep(10)

Thanks for reading this devarticle. Have a good day!

Comment what next logo to do!

Comments (0)