4. colon
start with ‘def’
function name
arguments
deftwotimes(n):
return2*n
‘return’ precedes
the value to be sent back
No declaration of types
of function or arguments
27. Why Python?
•Easy to learn syntax
•Built-in datatypes for lists, strings etc.
•Runs on many types of machines
•Many scientific librartes (SciPy, NumPy)
•Large community of scientists using it
•#1 programming language in universities
•Shell mode for experimentation
28. Why Python?
•Easy to learn syntax
•Built-in datatypes for lists, strings etc.
•Runs on many types of machines
•Many scientific librartes (SciPy, NumPy)
•Large community of scientists using it
•#1 programming language in universities
•Shell mode for experimentation
•Awesome Excel integration