First page Back Continue Last page Overview Graphics
Statements
Assignments – Create reference s = 'ciao'
Calls – Running functions stdout.write('ciao\n')
print – Print objects print “Hello World!”
if/elif/else – Select action if x>10: print x
for/else – Sequence iteration for i in range(10): print i
while/else – General loop while 1: print “ciao”
pass – Empty placeholder while 1: pass
break/continue – Loop jumps while 1: if not line: break
try/except/finally, raise – Catching and raising exceptions
import, from – Module access from Numeric import *
def/return – Build functions def f(x): return x+1
class – Building objects class MyClass(): MyData = []
del – Deleting things del data[k] del variabile
exec – Running code strings exec “print 'ciao'”