From this, we can create a class called Felicitations:
class Felicitations(object):
def __init__(self):
self.felicitations = [ ]
def addon(self, word):
self.felicitations.append(word)
def printme(self):
greeting = string.join(self.felicitations[0:], "")
print greeting
The class is based off of another type of object called 'object'. The first function is mandatory; the class must have a way of referring to itself. The second method simply adds the value of variable word to the Felicitations object. Finally, this class has the ability to print itself via a method called printme. This final method joins the various fields of the object, separating them by no space, and prints them.
In Python, indentation is important. Every nested block of commands must be indented the same amount. Python has no other way to differentiate between nested and non-nested blocks of commands.
