On 07/12/10 22:10, Al Stern wrote:
Using attributes.values is fine. There is a built in function for summing all the values in a sequence, it's called "sum".Tried to use the documentation but still getting the errors... The 1st one has to do with the available_points # set variables attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = 30 available_points = MAX_POINTS - attributes.values() keys = attributes.keys() values = attributes.values() this is the error i'm getting... Traceback (most recent call last):File "C:\Users\Public\Documents\My Python programs\role_playing_game1.py", line 8, in <module>available_points = MAX_POINTS - attributes.values() TypeError: unsupported operand type(s) for -: 'int' and 'dict_values'I know using attributes.values here isn't correct but I can't figure out how to put the sum of the values into that equation.
HTH Adam. _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
