4 - Code_Aster and Salome-Meca course material GNU FDL Licence
Python basis
Structure of a Python program
No type declaration. Variables directly affected by the sign =
b = 12.2
a = 4. * b + 2.
Code blocks indicated by indentation uniform (important)
i = 0
while i <10:
print i
i = i + 1
print 'finished'
Case sensitive
Mesh is different from MESH
Comments preceded by #
Reserved keywords
and, assert, break, class, continue, def, del, elif, else,
except, exec, finally, for, from, global, if, import, in, is,
lambda, not, or, pass, print, raise, return, try, while