The class:
class Race():
def __init__(self,raceName,special_abilites = [], race_strength=0, race_dexterity=0, race_constitution=0, race_intelligence=0, race_wisdom=0, race_charisma=0, size="none", speed=0):
self.raceName = raceName
self.special_abilites = special_abilites
self.race_strength = race_strength
self.race_dexterity = race_dexterity
self.race_constitution = race_constitution
self.race_intelligence = race_intelligence
self.race_wisdom = race_wisdom
self.race_charisma = race_charisma
self.size = size
self.speed = speed
def printRace(self, *args):
print(f"{raceName}, {race_strength}, {race_dexterity}, {race_constitution}, {race_intelligence}, {race_wisdom}, {race_charisma}, {size}, {speed}".center(150))
Now I try to run this bit:
Human = Race.printRace("Human","medium",30)
print(Human)
and then it gives me:
Traceback (most recent call last):
File "DnD game engine.py", line 20, in <module>
Human = Race.printRace("Human","medium",30)
File "DnD game engine.py", line 18, in printRace
print(f"{raceName}, {race_strength}, {race_dexterity}, {race_constitution}, {race_intelligence}, {race_wisdom}, {race_charisma}, {size}, {speed}".center(150))
NameError: name 'raceName' is not defined
If you can find the cause it would be appreciated greatly, Thanks!
What I have tried:
Google which didn't turn up anything good, and Documentation which I couldn't find anything in either