Pig game in Python
Question: I'm trying to write a pig game in python. Here is my code:

    
    
    from random import *
    roll_q = raw_input('would you like to roll')
    if roll_q == (' yes'):
        while True:
            num1 = randint(1,6)
            print str(randint)
            if randint == 1:
                print('your turn is over')
                total = 0
            else:
             num1 = randint(1,6)
             print ('you got ') + str(randint) + ('points')
             total = randint
             print str(total)
             total=total + randint
             cont_q = raw_input('would you like to continue playing')
             if cont_q == ('yes'):
                    print ('awesome')
             else:
                    print ('ok')
    else:
        print ('awesome')
    

When I ran this program I got asked if I wanted to roll and printed something.
But then it gave me an error I didn't understand.

    
    
    would you like to roll yes
    <bound method Random.randint of <random.Random object at 0x89b010>>
    you got <bound method Random.randint of <random.Random object at 0x89b010>>points
    <bound method Random.randint of <random.Random object at 0x89b010>>
    
    Traceback (most recent call last):
      File "/Users/centralcity/Desktop/Computer Science!/pig game", line 15, in <module>
        total=total + randint
    TypeError: unsupported operand type(s) for +: 'instancemethod' and 'instancemethod'
    

Please help me understand the error and why my program isn't printing right.
Thanks in advance.


Answer: You keep saying `randint` where you should say `num1`. After you call
`randint` with `randint(1,6)` you store the result in `num1`, so the lines
afterward should refer to `num1`.

    
    
    if roll_q == (' yes'):
        while True:
            num1 = randint(1,6)
            print str(num1)
            if num1 == 1:
                print('your turn is over')
                total = 0
            else:
             num1 = randint(1,6)
             print ('you got ') + str(num1) + ('points')
             total = num1
             print str(total)
             total=total + num1
             cont_q = raw_input('would you like to continue playing')
             if cont_q == ('yes'):
                    print ('awesome')
             else:
                    print ('ok')
    

