Now, we can make a function which calls the last method of the class:
def prints(string):
string.printme()
return
Next, we define two more functions. These illustrate how to pass arguments to and how to receive output from functions. The strings in parentheses are arguments on which the function depends. The value returned is signified in the 'return' statement at the end.
def hello(i):
string = "hell" + i
return string
def caps(word):
value = string.capitalize(word)
return value
The first of these functions takes an argument 'i' which is later concatentated on to the base 'hell' and returned as a variable named 'string'. As we shall see in the main() function, this variable is hardwired in the program as 'o', but you could easily make it user-defined by using sys.argv[3] or similar.
The second function is used to capitalize the parts of the output. It takes one argument, the phrase to be capitalized, and returns it as a value 'value'.
