All pastes #87778 Raw Edit

freeone3000

public python v1 · immutable
·published 2006-07-14 05:33 UTC
rendered paste body
def __init__(self, name="Legolas10921", skills={"attack": 3, "defence": 3, "harvesting": 0, 'alchemy': 0, 'magic': 0, 'potion': 0}):		"""Creates a new player card.		Takes two arguments - the name, and then the skills in a dictionary "attack", "defence", "harvesting",		"alchemy", "magic", and "potion". Their values must be integers, or be able to be		added and multiplied by integers."""		super(player_card, self).__init__(name, True)				if self.skills.keys() != skills.keys():			raise InvalidArgumentException("You do not have the keys: %s" % (str(self.skills.keys()), ))		skills['overall'] = 0		for skill in skills:			skills['overall'] += skill==Traceback (most recent call last):  File "elcards.py", line 26, in ?    c = card.player_card()  File "/home/james/develop/elcards/card.py", line 68, in __init__    skills['overall'] += skillTypeError: unsupported operand type(s) for +=: 'int' and 'str'