iNTERFACEWARE Products Manual > Learning Center > Learning Python > Working With Values and Variables |
|
Looking for Iguana v.5 or v.6? Learn More or see the Help Center.
The following basic building blocks can be found in most scripts written in Python:
In addition, most standalone Python scripts contain print statements that display values or the contents of variables on the screen. A Python script contained in Chameleon may contain print statements if you are debugging the script or logging information. Here is an example of a simple Python script that uses these basic building blocks:
This script consists of a sequence of instructions, or statements, to be performed. You can use a Python interpreter, such as IDLE, to perform these instructions. When an interpreter performs the instructions in the script, the following output is displayed:
If you have previous programming experience, you will have little difficulty understanding the code in this example, as Python is similar to many programming languages in common use.
If you do not have programming experience, the following sections describe the features of Python that are illustrated in this example, along with some other basic features: |