python: why am I not exiting while loop?
Question: Can't find anything applicable to the problem I have here. If there is, please
point me toward it. Anyway, as a new one to python, I can't understand why my
output here keeps repeating indefinitely.

    
    
    from random import randint
    dollars = int(input("How many dollars do you have? "))
    
    maxdollars = dollars
    countatmax = 0
    count = 0
    
    while dollars > 0:
        count += 1
        diceone = randint(0, 6)
        dicetwo = randint(0, 6)
        if diceone + dicetwo == 7:
            dollars + 4
        else:
            dollars - 1
        if dollars != maxdollars:
            mostdollars = dollars
            countatmax = count
        print "You are broke after " + str(count) + " rolls.\n" + \
              "You should have quit after " + str(countatmax) + \
              " rolls when you had $" + str(maxdollars) + "."
    


Answer: Yes, like Karin said, you are not changing the value of dollars with these
statements:

    
    
    if diceone + dicetwo == 7:
        dollars + 4
    else:
        dollars - 1
    

since the amount of "dollars" never gets changed, your while loop will loop
forever (dollars will always be greater than zero) assuming that the user
inputs a positive value

