Python: Random integer

Posted by user3696440 on Stack Overflow See other posts from Stack Overflow or by user3696440
Published on 2014-06-01T09:19:48Z Indexed on 2014/06/01 9:25 UTC
Read the original article Hit count: 136

Filed under:

I been hitting a wall thats been keeping me from tinkering on a game.

class Damage:
def shortsword():
    shortsword=randint(1,6)+1
    shortsword=int(shortsword)
    return shortsword

I been wanting this number to pop up as part of a message on print and then use the same number as part of another function to help with subtracting of health on the target. Though each time I grab this it is always going to change.

© Stack Overflow or respective owner

Related posts about python