Information for Teachers#
WebTigerPython runs entirely in the browser, so students do not need to install anything. Programs are stored in the browser, so they are kept when the page is reloaded, and can be shared with a link.
The TigerPython Dialect#
TigerJython / TigerPython is a dialect of Python with a few didactic changes. In WebTigerPython, the whole feature set of Python can be used with a few additional didactic features.
If you want to use standard Python without these additions, use WebEduPy, the sister IDE of WebTigerPython. It offers the same environment, but uses regular Python. The “Vanilla Python” option (vanilla_python) is deprecated: old links that enable it automatically redirect to WebEduPy.
The repeat loop#
In WebTigerPython, the repeat loop additionally exists, so loops can be introduced without understanding the concept of variables. The repeat loop can be used with and without a parameter.
repeat 4:
# do something
is equivalent to
for _ in range(int(4)):
# do something
and
repeat:
# do something
is equivalent to
while True:
# do something
The input functions#
input() automatically converts the input to the fitting data type: a number becomes an int or float, True / False become a bool, and a comma separated list of these values (e.g. 1, 2, 3) becomes a list. Everything else stays a string.
Additionally, these functions can be used:
Function |
Description |
|---|---|
|
Asks for an integer |
|
Asks for a decimal number |
|
Asks for a text, which is not converted |
|
Asks a yes / no question and returns |
|
Shows a message |
Additional List accessors#
Lists have the additional fields first and last (with the aliases head and tail). They can be used to read and to change the first / last element.
list.first is equivalent to list[0] and list.last is equivalent to list[-1].
Example:
l = [1, 2, 3, 4]
l.first = 10
print(l.last) # prints 4
print(l) # prints [10, 2, 3, 4]
Additional Type checkers#
isInteger(value)isFloat(value)isString(value)isBoolean(value)isList(value)isDictionary(value)
Each of them is equivalent to isinstance(value, type) called with the corresponding type.
Additional Functions#
sqrt(square root) can be used without being imported frommath.
Robotics#
The micro:bit, the Calliope mini and other devices can be programmed directly from the browser. WebUSB, Web Bluetooth and Web Serial are only supported by Chromium-based browsers such as Google Chrome or Microsoft Edge. Without a device, the programs can be tested in the simulator. See Robotics.
Teaching Material#
Books#
Informatik für Maturitätsschulen (Klett und Balmer)
Einfach Informatik 7–9 (Klett und Balmer)
Websites#
Python Online: tutorials for turtle graphics, GPanel, robotics and more
TigerJython: learning material for TigerJython, e.g. on GameGrid
Classroom Management Tools with integrated TigerPython#
WebTigerPython Classroom (still in alpha testing, do not use it in class yet)
Exams#
WebTigerPython can be used in the Safe Exam Browser.
To use WebTigerPython in the Safe Exam Browser, you have to whitelist the following links:
https://webtigerpython.ethz.ch/*
WebTigerPython detects when it runs in the Safe Exam Browser and disables all features that reach outside of the machine: the file system can only use the local workspace, Git and OneDrive are not available.
iPads#
Note
In earlier versions, turtle graphics and the input functions were blocked on iPads in the Safe Exam Browser. This should work now. If you still run into problems, please contact the WebTigerPython team. As a fallback, WebTigerJython, the predecessor of WebTigerPython, can be used for exams on iPads.