"Not enough Points" Python -
st = 5 statadd = 5
there more had typed, none of relevant, copied this.
while statadd > 0: addstat = raw_input("""you may distribute %s points base stats. add to? """ %(statadd)) if addstat == 'strength': pointdeduction = raw_input("how many points wish add strength? (up %s points)" %(statadd)) if pointdeduction <= statadd: st += pointdeduction statadd -= pointdeduction else: print "you not have many points distribute strength."
you think should add points, keep getting same error "you not have many points distribute strength" when do. doing wrong here?
try convert inputs to int
? otherwise it's string , doing arithmetic operations on lead unexpected results.
while statadd > 0: addstat = int(raw_input("""you may distribute %s points base stats. add to? """ %(statadd))) if addstat == 'strength': pointdeduction = int(raw_input("how many points wish add strength? (up %s points)" %(statadd))) if pointdeduction <= statadd: st += pointdeduction statadd -= pointdeduction else: print "you not have many points distribute strength."
Comments
Post a Comment