In this tutorial, we will be learning how to draw Netflix logo using Python Turtle. We’ll divide the process into 3 parts, and explain each one of them.
1- Import the module and initialize it
import turtle
from time import sleep
# Part 1 : Initialize the module
t = turtle.Turtle()
t.speed(4)
turtle.bgcolor("white")
t.color("white")
turtle.title('Netflix Logo')
What we are doing here is basically importing the ‘turtle’ module, initializing it using ‘turtle.Turtle()’, then setting our configuration, like the drawing speed, the main window background color, the trace color of the turtle, and the title of the drawing window.
2- Draw the logo black background
As we all know, the Netflix logo has a black square background rounded on the borders. So let’s draw it.
# Part 2 : Drawing the black background
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()
What we are doing here is drawing the black background square by tracing 4 lines, and at the same time making rounded borders using a loop on each corner.
3- Complete the logo
We’re almost done! Drawing the letter N that stands for Netflix is the only thing left. This is the most important part of our article to Draw Netflix logo.
# Part 3 : Drawing the N shape
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)
First, we changed the turtle trace color from white (in part 1) to black so we don’t leave white traces on the black background. Then, we placed the turtle in the position where we should start drawing the shape and changed the trace color to red. Finally, we drew 3 rectangles: 2 that are parallel to each other and the third one connected them.
Output
Complete code to Draw the Netflix logo using Python Turtle
Here you go! You just made the Netflix logo! The full code should look like this :
import turtle
from time import sleep
# Part 1 : Initialize the module
t = turtle.Turtle()
t.speed(4)
turtle.bgcolor("white")
t.color("white")
turtle.title('Netflix Logo')
# Part 2 : Drawing the black background
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()
# Part 3 : Drawing the N shape
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)
Video Output
I hope you enjoyed our article to draw the NetFlix logo using Turtle in Python. Stay tuned for more…
Visit our website to check out new articles related to the Python Programming language.
Also Read:
- Imagination to Reality, Unlocking the Future: Genesis Physics Engine for 4D Simulation
- Simple Code to compare Speed of Python, Java, and C++?
- Falling Stars Animation on Python.Hub October 2024
- Most Underrated Database Trick | Life-Saving SQL Command
- Python List Methods
- Top 5 Free HTML Resume Templates in 2024 | With Source Code
- How to See Connected Wi-Fi Passwords in Windows?
- 2023 Merry Christmas using Python Turtle
- 23 AI Tools You Won’t Believe are Free
- Python 3.12.1 is Now Available
- Best Deepfake Apps and Websites You Can Try for Fun
- Amazon launched free Prompt Engineering course: Enroll Now
- 10 GitHub Repositories to Master Machine Learning
- Hello World in 35 Programming Languages
- How to Scrape Data From Any Website with Python?
- Become Job Ready With Free Harvard Computer Science course: Enroll Now
- Free Python Certification course from Alison: Good for Resume
- Download 1000+ Projects, All B.Tech & Programming Notes, Job, Resume & Interview Guide, and More – Get Your Ultimate Programming Bundle!
- Udacity Giving Free Python Course: Here is how to Enroll
- Love Babbar’s Income Revealed
- Top 5 Websites to Learn Programming in 2024
- Python Internship for college students and freshers: Apply Here
- Microsoft Giving Free Python Course in 2023: Enroll Now
- Top 5 Free Python Courses on YouTube in 2024
- Complete Python Roadmap for Beginners in 2024
- New secrets to Earn money with Python in 2024