Back
Contents Overview of the program structure chart elements

Kind and purpose
Program structure chart
Python
Instruction
Variable assignments,
Function calls

x = 5
text = "hello"
f=funktion(42)
Block

step by step execution of several instructions


Line by line run
the instructions
Output
show text and variable

print "Ausgabe", 12345
Input
Input of text

x = raw_input ("enter text")
if....then
execute dependent on a condition

if condition:
 anweisungsblock1
else :
 anweisungsblock2

The block statements must
are engaged!
rejecting loop
Repeat block statement, as long as a condition is fulfilled.

while condition:
 block statement

enumerating loop
Way successively all indicated elements of the variables too and call the instruction.

for variable in list:
  block statement


Function
A function or a procedure leads groups a consequence of instructions and makes these available under a name for other program sections. A function can get (does not need however) parameters as input and supply an return value.

def function(parameter):
  block statement
  return result

return instruction
Terminates a function (immediately) and can (optionally) return a result.

see function
Class

A class with methods (represented as function) makes available. An explanation blows up here the framework.

class name:
 def methode1(self,parameter):
   block statement