If you are not familiar with functions, refer to Getting Started with functions in Python.
AVOID TROUBLE
A function must be define before the function is called in the script. For example, let's say you call the "foo" function before the foo function is defined.
#!/usr/bin/python
Hello "World"
def Hello(greeting):
print greeting
This will return an error that looks something like this.
Traceback (most recent call last):
File "/home/john.doe/testing.py", line 3, in <module>
Hello("World")
NameError: name 'Hello' is not defined
In this example, values "Hello" and then "World" are passed into the Hello function.
The values passed into the Hello function are placed in the "greeting" variable.
#!/usr/bin/python
def Hello(greeting):
print greeting
Hello("Hello")
Hello("World")
Here is how you would pass two (or more) values into a function.
#!/usr/bin/python
def Hello(one,two):
print one
print two
Hello("Hello", "World")