Graphics Using Python
Graphics Using Python
Graphics Using Python
A PROJECT BY:
SHASHWATI AND CHARUL
(First Year Engineering Depatment)
GUIDED BY:
PROF. PALLAVI MANKAR
GRAPHICS USING PYTHON
What is Turtle Graphics?
Logo is an educational programming language designed in 1967 by Daniel
G. Bobrow, Wally Feurzeig, Seymour Papert and Cynthia Solomon.
Today the language is remembered mainly for its use of “Turtle Graphics”
which commands for movement and drawing produced line graphics on
screen with a small pointer called a “Turtle”.
Turtle in Python
For the background color we can use the turtle function bgcolor(). Set the
background color to black.
Next we need to create the object turtle using Turtle() and store it in the
variable t.
SPIROGRAPHIC
The colors purple and violet are used. We can define them here in a list.
We need to set the speed of the robotic turtle in order to move it with a
uniform speed. The speed() function does this job.
SPIROGRAPHIC
We can use a for loop here and loop about 400 times with the range()
function.
With the forward() function we draw a straight line. Next we need to define
the angle. In one iteration of the loop we want to use purple, the next
iteration violet and keep alternating like that in each iteration.
SPIROGRAPHIC
Finally let write turtle.done() to keep the screen open after
the code is done running.