Micro Project: Advanced Python Programming
Micro Project: Advanced Python Programming
Using the Python turtle library, we can draw and create various
types of shapes, images, mini-games, and animations.
Turtle’s Method :-
1. fillcolor()
The fillcolor() method is used to change the color of the turtle. The fillcolor() method
has one argument that is the color name.
2. tracer()
the turtle. tracer() function to draw shapes pictures. Tracer is used to turn the
animation on-off and also set a delay for updating our drawing objects.
3. seth()
SETHEADING (seth) turns the turtle to the degree position specified by its input.
Positive numbers turn the turtle clockwise and negative numbers turn the
turtle anti clock-wise.
4. fd()
forward is a turtle primitive that makes the asked turtle move forward on a straight
patch for a provided number of units.
5. circle(x, y)
circle() command is used to draw a circle shape with the help of a turtle.
6. pensize()
We can set the width of the pen using pensize() method. The pensize() method has one
argument that is a positive number.
7. penup()
The penup() or the pu() method picks up the turtle’s pen and we can move the turtle
without drawing.
8. pendown()
The pendoen() or pd() method puts down the turtle’s pen. We can bring the turtle down
and draw.
9. dot()
The dot() is used to draw a filled circle.
10. goto()
Moves the turtle from the current position to the location x, y along the shortest linear
path between the two locations.
11. speed()
We can control the speed of pen using the speed() method. The speed() method has
one argument that is a positive number.
12. screensize()
To change screen size we can use screensize() method. The screensize method has
two arguments – (canvase height, canvas width) coordinates./
13. bgcolor()
We can modify the background color using the bgcolor() method. The bgcolor()
method has one argument that is the color name.
For example, if the current pen color is Red, then any shape we draw in between
begin_fill() and end_fill() will be filled with the color Red. If the color of the pen is
currently Blue, then any shape drawn will be filled with Blue.
Ex :- Draw famous character Doraemon using
turtle module.
OUTPUT :-