If you are using the standard installation of Python from python.org which comes with the IDLE editor, there are some exciting demonstrations of the power of the turtle module available at the click of a mouse.
The turtle module is hugely useful for learning about and teaching programming, and also great fun. It provides a way to express computational concepts in a visual form and provides easy-to-interpret feedback on what is happening in a program.
To get an idea of what is possible with Python and the Turtle module, select the help menu in IDLE and click on
Turtle Demo. Then choose one of the examples from the menu and off you go!
Many of the examples use straightforward procedural code so should be fairly eady to understand – for example
yinyang. Others make use object oriented programming (
Nim for example), which is great if you are learning or teaching A Level Computer Science.
One great thing about the demos is that you can copy the code and adapt it to your own needs.
Here is the code for
from turtle import *
def yin(radius, color1, color2):
yin(200, "black", "white")
yin(200, "white", "black")
if __name__ == '__main__':
Plenty of bits in there you can make use of I expect.
The Turtle module in Python is awesome. I hope you have fun with it.