To add to Chistians good advice, it is not neccessary to use getters and setters in simple cases like the self.name. Actually, you just want to read it and assign it. After creating the instance, you can simply access the internal data member as a normal variable. What is named self inside the definition, takes the name of the instance outside. The def getName(): can be comletely removed:
dwarf1 = Dwarf('Bob', 200)
print(dwarf1.name,dwarf1.health)
# Changing the health.
dwarf1.health = 150
print(dwarf1.name,dwarf1.health)
The getters and setters should only be used when you need to do something more than simply reading the value or assigning the value (say some checking or having read only variable). But in such case, you should use Python properties or via the property() function, or possibly more readable the @property decorator -- see http://docs.python.org/3.3/library/functions.html#property
Actually, it seem that you want to share the same set of properties for both Dwarf and Mage -- only the values differ. You can distinguish the class by the class name passed when the object is created like this:
class Being:
def __init__(self, clsname, name):
self.name = name
self.clsname = clsname
if self.clsname == 'dwarf':
self.health = 150
self.mana = 10
self.stamina = 15
self.base_attack = 20
self.melee_attack = 0
self.elemental_attack = 5
elif self.clsname == 'mage':
self.health = 10
self.mana = 20
self.stamina = 5
self.base_attack = 5
self.melee_attack = 0
self.elemental_attack = 20
Notice that self.name is distinguished from self.clsname. Now you can create dwarfs and mages like this:
dw1 = Being('dwarf', 'Bob')
dw2 = Being('dwarf', 'John')
mag1 = Being('mage', 'Merlin')
mag2 = Being('mage', 'Gandalf')
After some trial and failures you will find that it is really easier to define a base class Being and the derived classes Dwarf and Mage...
returncommand is part of the function body and must be indented. Without any argument it returns the value namedNone. You get no other value from inside the function.