0% found this document useful (0 votes)
8 views2 pages

Turtle Graphics: Draw Ganesha

The document contains a Python script that uses the turtle graphics library to draw a representation of Ganesha. It defines functions to draw Ganesha's body, hands, and eyes, and sets up the turtle's speed and background color. The script concludes by executing the drawing functions and hiding the turtle cursor.

Uploaded by

Apeksha H P
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views2 pages

Turtle Graphics: Draw Ganesha

The document contains a Python script that uses the turtle graphics library to draw a representation of Ganesha. It defines functions to draw Ganesha's body, hands, and eyes, and sets up the turtle's speed and background color. The script concludes by executing the drawing functions and hiding the turtle cursor.

Uploaded by

Apeksha H P
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

import turtle

# Set up turtle
t = [Link]()
[Link](5)
[Link]("white")

# Draw Ganesha's body


def draw_body():
[Link]("orange")
t.begin_fill()
[Link](70) # Head
t.end_fill()

[Link]("yellow")
t.begin_fill()
[Link](90)
[Link](100)
[Link](90)
[Link](70, 180)
[Link](90)
[Link](100)
t.end_fill()

# Draw left hand


def draw_left_hand():
[Link]("orange")
[Link]()
[Link](-90, -30)
[Link]()
t.begin_fill()
[Link](30)
t.end_fill()

# Draw right hand


def draw_right_hand():
[Link]("orange")
[Link]()
[Link](90, -30)
[Link]()
t.begin_fill()
[Link](30)
t.end_fill()

# Draw eyes
def draw_eyes():
[Link]()
[Link](-20, 40)
[Link]()
[Link]("black")
t.begin_fill()
[Link](5)
t.end_fill()

[Link]()
[Link](20, 40)
[Link]()
t.begin_fill()
[Link](5)
t.end_fill()

# Draw Ganesha
def draw_ganesha():
draw_body()
draw_left_hand()
draw_right_hand()
draw_eyes()

# Move to starting position


[Link]()
[Link](0, 0)
[Link]()

# Draw Ganesha
draw_ganesha()

# Hide turtle and finish


[Link]()
[Link]()

You might also like