• Home
  • Privacy Policy
  • About Us
  • Contact Us
×
 Posted in allcategorites, python turtle

Draw an Android Logo using Python Turtle

 Ayush Purawr  May 11, 2022
Android Logo using Python Turtle

Introduction

In this article, we’ll look at how to draw an Android Logo using Python Turtle module. Install the turtle python package to create the Android logo. We can create any type of graph using the turtle module. See the complete code for the Android logo below.

Let’s Code!

Step 1. First of all import the libraries to draw the logo

import turtle as t

Turtle is a python library, it is used to draw shapes.

Step 2. Setup the Background and Pen Location

t.bgcolor("gray")
t.penup()
t.goto(-80,80)
t.pendown()
t.pencolor("#3DDC84")

here penup() function will lift the turtle off the digital canvas, the goto function is used to move the cursor to the desired location, and pendown() is mostly useful to reestablish pendown state after using .penup(). Pencolor() function is used to set the pen color

Step 3. Creating a function to draw circles

def circle():
    t.begin_fill()
    t.fillcolor('white')
    t.circle(7)
    t.end_fill()

Creating a circle() is used to draw the circles for the eyes. begin_fill() function is used to fill the color in particular shapes. and to choose and fill the color we use fill_color().

Step 4. Drawing the Upper Body of Android Logo.

def draw_upperbody():
    t.begin_fill()
    t.fillcolor("#3DDC84")
    t.forward(150)
    t.left(90)

    for i in range(238):
        t.left(0.76)
        t.forward(1)
    t.end_fill()
    
    #drawing eyes
    #left Eye
    t.penup()
    t.goto(-46,120)
    t.pendown()
    circle()
    
    #Right Eye
    t.penup()
    t.goto(24,120)
    t.pendown()
    circle()
    
    #Drawing ears
    #left ear
    t.penup()
    t.goto(-40,140)
    t.pendown()

    t.pensize(4)
    t.right(140)
    t.forward(50)

    #Right ear
    t.penup()
    t.goto(34,144)
    t.pendown()

    t.pensize(4)
    t.right(80)
    t.forward(46)

This function is responsible for creating an android body. in this function, the code is pretty easy to understand. we put one for a loop. And use some by default functions to draw the body

Step 5. Draw the Middle body of the Android logo.

def draw_middlebody():
    t.begin_fill()
    t.fillcolor("#3DDC84")
    t.pensize(1)

    t.right(141)
    t.forward(100)

    for i in range(20):

        t.forward(1)
        t.left(5)
    t.right(9.5)
    t.forward(127)

    for i in range(20):
        t.forward(1)
        t.left(5)
    t.right(9.5)
    t.forward(100)
    t.end_fill()

To draw the middle body, We use two for loops first forward(127) right(9.5) and in the second loop we take forward(100) right(9.5) then fill the color “end_fill”.

Step 6. Drawing the hands of Android Logo.

#hand
def draw_hand():
    t.begin_fill()
    t.fillcolor("#3DDC84")
    for i in range(45):
        t.right(4)
        t.forward(1)
    t.forward(70)
    for i in range(45):
        t.right(4)
        t.forward(1)
    t.forward(70)
    t.end_fill()

This function is used to construct both the left and right hands of the Android logo.

Step 7. Draw the lower body of the Android.

#legs
def draw_legs():

    t.begin_fill()
    t.fillcolor("#3DDC84")
    t.right(91)
    t.forward(30)
    t.right(90)
    t.forward(50)

    for i in range(45):
        t.right(4)
        t.forward(1)

    t.end_fill()

This code is responsible for creating both the left and right legs of the Android Logo.

Complete code to draw Android Logo using Python Turtle

import turtle as t
t.bgcolor("white")
t.penup()
t.goto(-80,80)
t.pendown()

t.speed(8)
t.pencolor("#3DDC84")
    
def circle():
    t.begin_fill()
    t.fillcolor('white')
    t.circle(7)
    t.end_fill()
#Drawing the Head
def draw_upperbody():
    t.begin_fill()
    t.fillcolor("#3DDC84")
    t.forward(150)
    t.left(90)

    for i in range(238):
        t.left(0.76)
        t.forward(1)
    t.end_fill()
    
    #drawing eyes
    #left Eye
    t.penup()
    t.goto(-46,120)
    t.pendown()
    circle()
    
    #Right Eye
    t.penup()
    t.goto(24,120)
    t.pendown()
    circle()
    
    #Drawing ears
    #left ear
    t.penup()
    t.goto(-40,140)
    t.pendown()

    t.pensize(4)
    t.right(140)
    t.forward(50)

    #Right ear
    t.penup()
    t.goto(34,144)
    t.pendown()

    t.pensize(4)
    t.right(80)
    t.forward(46)
    
#Drawing the middle body
def draw_middlebody():
    t.begin_fill()
    t.fillcolor("#3DDC84")
    t.pensize(1)

    t.right(141)
    t.forward(100)

    for i in range(20):

        t.forward(1)
        t.left(5)
    t.right(9.5)
    t.forward(127)

    for i in range(20):
        t.forward(1)
        t.left(5)
    t.right(9.5)
    t.forward(100)
    t.end_fill()

#hand
def draw_hand():
    t.begin_fill()
    t.fillcolor("#3DDC84")
    for i in range(45):
        t.right(4)
        t.forward(1)
    t.forward(70)
    for i in range(45):
        t.right(4)
        t.forward(1)
    t.forward(70)
    t.end_fill()

#legs
def draw_legs():

    t.begin_fill()
    t.fillcolor("#3DDC84")
    t.right(91)
    t.forward(30)
    t.right(90)
    t.forward(50)

    for i in range(45):
        t.right(4)
        t.forward(1)

    t.end_fill()


draw_upperbody()

t.penup()
t.goto(-80,68)
t.pendown()

draw_middlebody()

t.penup()
t.goto(80,68)
t.pendown()

draw_hand()

t.penup()
t.goto(-124,70)
t.pendown()

draw_hand()

t.penup()
t.goto(-50,-50)
t.pendown()

draw_legs()

t.penup()
t.goto(14,-50)
t.pendown()
t.left(1.7)
draw_legs()


t.hideturtle()

t.done()

Output:

output to draw Android Logo using Python Turtle

Thank you for reading the article. Visit our home page for more articles like this.


Also Read:

  • ChatGPT Asked a person to commit suicide to solve the problem
  • Viral Moment: China’s AgiBot X2 Makes History With World’s First Webster Backflip
  • Terminator Rising: Albania Hands Power to AI, Echoing a Nightmare of Human Extinction
  • What Is Albania’s World-First AI-Generated Minister and How Does It Work?
  • Does ChatGPT believe in God? ChatGPT’s Personal Opinion
  • ChatGPT vs Human: The Breath-Holding Chat That Ends in “System Failure”
  • What Is Vibe Coding? The Future of No-Code Programming and Its Impact on Software Developers
  • Struggling to Generate Ghibli-Style AI Images? Here’s the Real Working Tool That Others Won’t Tell You About!
  • ChatGPT vs DeepSeek: Who is the winner?
  • People are becoming AI Engineer with this free course in 2025: Here is how to join this…
  • Apply to Google’s Student Training in Engineering Program (STEP) Intern, 2025
  • Self-Driving Car Saves Falling Pedestrian, Showcases Promise of Autonomous Technology
  • Instant Karma: Employer Fires Tech Team with AI, Faces Backlash on LinkedIn While Seeking New Developers
  • LinkedIn’s COO Reveals the AI Interview Question That Could Land You the Job in 2025
  • Elon Musk’s xAI Raises $6 Billion, Valued at $45 Billion
  • Google Unveils Veo 2 and Imagen 3: A New Era of AI-Generated Content
  • 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
  • Write for CopyAssignment.com | Unlock Your Potential: Join CopyAssignment.com as a Blog Writer! 🚀
  • 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
Tagged android, Android Logo using Python Turtle, logo
Share:

Author: Ayush Purawr

Related Articles

  • Top 15 Java Projects For Resume
  • Write Happy Halloween in Python Turtle
    Write Happy Halloween in Python Turtle
  • Car Race Game in Java
    Simple Car Race Game in Java
  • Ludo Game in Java
    Ludo Game in Java

Post navigation

← Stopwatch Using Python Tkinter
Creating a Pong Game using Python Turtle →

Search

Recent Posts

  • ChatGPT Asked a person to commit suicide to solve the problem
  • Viral Moment: China’s AgiBot X2 Makes History With World’s First Webster Backflip
  • Terminator Rising: Albania Hands Power to AI, Echoing a Nightmare of Human Extinction
  • What Is Albania’s World-First AI-Generated Minister and How Does It Work?
  • Does ChatGPT believe in God? ChatGPT’s Personal Opinion
  • ChatGPT vs Human: The Breath-Holding Chat That Ends in “System Failure”

Copyright © 2025 CopyAssignment