HomeTurtlegraficsGPanelRobotics WebTigerPython |
Python - Online |
Deutsch English |
YOU LEARN HERE... |
that a program consists of a sequence of program lines that are processed one after the other (as a sequence). You use a graphics window with a Turtle, which can be controlled with commands similar to a small robot. Turtle commands always end with a pair of brackets called parameter brackets. This can contain further information for the command. Even if no information is required, an empty pair of brackets must be present in Python. As you already know, it is important to adhere exactly to upper/lower case. The Turtle leaves a trail when it moves. It is as if it were carrying a drawing pen(s) resting on the drawing surface. This enables it to draw beautiful figures. |
EXAMPLE |
Before the Turtle can get started, you must instruct the computer to provide the Turtle commands from a module. To do this, write
from gturtle import *
Program: from gturtle import * makeTurtle() forward(100) left(90) forward(50) left(90) forward(50) right(90) forward(50) Click on the WebTigerPython or WebTigerJython button to insert the program into the editor. You can also open the empty online editor first and type in the program or copy it from the template. To do this, click on the Copy to clipboard link and paste the program using Paste (Ctrl-V, Ctrl-V) |
REMEMBER... |
You must make a difference between writing (editing) the program and executing it by clicking the Run button. Find out about the settings of the editor window under "Home/WebTigerPython". |
TO SOLVE BY YOURSELF |
|
In TigerJython and WebTigerJython, a turtle must be created at the beginning of each program with the line makeTurtle(). It appears in the middle of the graphics window. If you forget this line, an error message appears.
In WebTigerPython is this line not required, but it is not an error if it is present.
In the following examples you can see the simpler version on the website, by clicking on the link “WebTigerJython” above the program, the program is inserted into the editor with makeTurtle() line.