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

Advanced Python Programming CH-5 Lect-1

Uploaded by

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

Advanced Python Programming CH-5 Lect-1

Uploaded by

meetmaghudiya125
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Advanced Python Programming

Graphics with Turtle


CH – 5
Lect-1

Compiled by :
Amisha D. Patel
Lecturer in Info.Tech.
Gov. Polytechnic Valsad
Learning Outcomes
After actively interacting with the content, you will be able to:

 Explain Turtle methods.


 Explain turtle programming – loops and conditional statements

CO3: Draw graphics using the turtle module.


Turtle
 Turtle is a special feathers of Python. Using Turtle, we
can easily draw in a drawing board.
 First we import the turtle module. Then create a
window, next we create turtle object and using turtle
method we can draw in the drawing board.
Steps to work with Turtle library
1. import turtle
2. Create an object of turtle.
3. Draw or write around using the turtle methods.
4. turtle.done()
Example
import turtle

t1=turtle.Turtle()

turtle.done()
import turtle

t1=turtle.Turtle()
t1.screen.bgcolor("black")
t1.color("red")
t1.screen.setup(300,300)
t1.write("hello")
t1.screen.title("First")

turtle.done()
Turtle Methods
1. Turtle
2. Done()
3. Shape()
4. Shapesize()
5. Title()
6. Bgcolor()
7. Color()
8. Fillcolor()
9. Pencolor()
10. Pensize()
11. Speed()
import turtle

t1=turtle.Turtle()

t1.shape("triangle")

t1.shapesize(5,5)

t1.screen.title("First")

t1.screen.bgcolor("black")
t1.color("red")
t1.fillcolor("blue")
t1.screen.setup(300,300)
t1.write("hello")

turtle.done()
import turtle

t1=turtle.Turtle()
t1.shape("circle")
t1.pensize(10)
t1.speed(5)
t1.forward(300)

tutle.done()
Thank you

You might also like