
Introduction
Hello and welcome friends to copyassignment.com. We all know the chrome browser very well as most of our surfing activities are done on chrome. We also look at the Chrome logo every now and then while browsing. But have you ever tried to draw the Logo? In this article, we are going to do the same. We are drawing the Chrome logo using Python Turtle module.
You will find the lines of code a little bit tricky, but don’t worry!! We are providing a detailed explanation of the code for better understanding. We are also putting comments for the lines of code which are easy to understand.
For the complete code, you just have to move down to the bottom of the page. Here you will get the code as well as the output.
So let’s begin drawing the Chrome Logo
Import Function
from turtle import *
Here we are importing all the turtle module methods and functions.
Draw the red shape of the Chrome Logo using Python Turtle
radius=120 #heading position -150 is opposite of 150 degree angle setheading(-150) penup() #-Red shape of the Chrome Logo color("red") begin_fill() forward(radius) pendown() right(90) #set the angle to 90 circle(-radius, 120) #forward distance is equal to 180 forward(radius*3**.5) left(120) #draw the circle angle 120 and radius of 240 circle(2*radius, 120) left(60) forward(radius*3**.5) end_fill()
In this code block, we are drawing the red shape of the chrome Logo. First, we have initialized the radius to 120. Set the heading position to -150. Initialized the color to red. We have set an angle of the turtle to right(90). The circle radius is initialized to -120 and the angle of 120 degrees. We have used the forward(radius*3**.5) function which equals to forward(180) distance to draw the straight line. Moved left to 120 degrees and drew another circle(2*radius,120) whose radius is 240 and the angle 120 degrees. After that moved to left(60) and drew a straight line of 180 distances using the function forward(radius*3**.5) . It completes the red shape.
Draw the green shape of the Chrome Logo
#------------Green ------------- left(180) color("green") begin_fill() forward(radius*3**.5) left(120) circle(2*radius, 120) left(60) forward(radius*3**.5) left(180) circle(-radius, 120) end_fill()
Here we have drawn the green shape of the chrome logo. We have made an angle of left(180). Draw a straight line using forward(radius*3**.5) function i.e 180 steps . Then provided angle of left(120). Draw a circle with a radius of 240 with an extent of 120 degrees. Set an angle left(60) and draw a straight line of 180 steps. After that set the angle to left(180) and draw a circle with a radius of -120 and an extent of 120 degrees.
Draw the yellow shape of the Chrome Logo
#-------------Yellow ------------- left(180) circle(radius,120) color("yellow") begin_fill() circle(radius, 120) right(180) forward(radius*3**.5) right(60) circle(-2*radius, 120) right(120) forward(radius*3**.5) end_fill()
In the piece of code, we are drawing the yellow shape of the chrome logo. The circle radius and extent is 120. Here while filling the yellow color, again we have to set the radius and the extent to 120. Angle is set to the right(180). Draw a straight line of 180 distances. Again set the angle to the right(60). Draw a circle of radius -240 with the extent of 120 degrees by using the function circle(-2*radius,120). Set the angle to the right(120) and draw a straight line of 180 steps. This completes the yellow shape.
Draw the middle Blue Circle of the Chrome Logo
#-------------Blue Circle------------- penup() left(98) forward(radius/20) setheading(60) color("blue") pendown() begin_fill() circle(distance(0,0)) end_fill() hideturtle() done()
In this last part of the code, we are drawing the circle of the Chrome logo. The angle is set to the left(98), We have to move them forward(radius/20) i.e 60 steps. Set the head position of the turtle to 60 degrees. Set the color of the circle to blue. And drawing the circle ends up the completion of logo designing.
Complete Code to Draw Chrome Logo using Python Turtle
from turtle import * radius=120 #heading position -150 is opposite of 150 degree angle setheading(-150) penup() #-Red shape of the Chrome Logo color("red") begin_fill() forward(radius) pendown() right(90) #set the angle to 90 circle(-radius, 120) #forward distance is equal to 180 forward(radius*3**.5) left(120) #draw the circle angle 120 and radius of 240 circle(2*radius, 120) left(60) forward(radius*3**.5) end_fill() #-------------Green ------------- left(180) color("green") begin_fill() forward(radius*3**.5) left(120) circle(2*radius, 120) left(60) forward(radius*3**.5) left(180) circle(-radius, 120) end_fill() #-------------Yellow ------------- left(180) circle(radius,120) color("yellow") begin_fill() circle(radius, 120) right(180) forward(radius*3**.5) right(60) circle(-2*radius, 120) right(120) forward(radius*3**.5) end_fill() #-------------Blue Circle------------- penup() left(98) forward(radius/20) setheading(60) color("blue") pendown() begin_fill() circle(distance(0,0)) end_fill() hideturtle() done()
Output

Here we have successfully completed the drawing of the Chrome Logo.
Thank you for reading the article.
Also Read:
- Unveiling the Future of AI Detector
- CodeWithHarry Earns 20 Lakhs per month from YouTube?
- Cleaning Service Booking System in Python Tkinter
- Farmers Ecommerce App using Python Tkinter
- Guidelines for Project Collaboration Process
- The system of the binary conversion
- What is web development for beginners?
- Guide to Proxy Servers: How They Work and Why You Need Them?
- Python | Check Armstrong Number using for loop
- Python | Factorial of a number using for loop
- Link in bio
- Microsoft Giving Free Machine Learning Course: Enroll Now
- Accenture Giving Free Developer Certificate in 2023
- Python | Asking the user for input until they give a valid response
- Python | How to iterate through two lists in parallel?
- Amazon Summer Internship 2023
- Python | How to sort a dictionary by value?
- Amazon Giving Free Machine Learning Course with Certificate: Enroll Now
- Google Summer Internship 2023
- Python | How to split a list into equally-sized chunks?
- 5 Secret ChatGPT skills to make money
- Python | Remove items from a list while iterating
- Free Google Certification Courses
- 5 AI tools for coders better than ChatGPT
- Python | How to get dictionary keys as a list
- New secrets to Earn money with Python in 2023
- Flower classification using CNN
- How to represent Enum in Python?
- 5 methods | Flatten a list of lists | Convert nested list into a single list in Python
- What does if __name__ == __main__ do in Python?