Thread: Conversions
View Single Post
Old Apr 27th, 2005, 4:36 AM   #5
hydroxide
Programmer
 
Join Date: Apr 2005
Posts: 73
Rep Power: 4 hydroxide is on a distinguished road
Your problem is the str = 12 line. After that, doing str(whatever) is equivalent to doing 12(whatever)!! You could:
  • Spell it out in full - strength
  • use all caps - STR
  • use a class (which for an RPG you should be doing anyway ;-) and make stats properties of that class
    class Actor(object):
        def __init__(self, strength):
            self.strength = strength
    
    player = Actor(12)
    print player.strength

--OH.
hydroxide is offline   Reply With Quote