How to stop infinite loop?
<p>Problem: Compute two integers based upon the user input that in the first is doubled repeatedly while second is divided by two. At each step, if second number is odd add current value of first number to itself until second number is zero.</p>

<p>My code doesn't seem to run completely, and I get an infinite loop what am I doing wrong? I'm using python 2.7.3</p>

<pre><code>##
## ALGORITHM:
##     1. Get two whole numbers from user (numA and numB).
##     2. If user enters negative number for numB convert to positive.
##     3. Print numA and numB.
##     4. Check if numB is odd if True add numA to numA.&amp; divide numB by 2 using int division.
##        Print statement showing new numA and numB values.
##     5. Repeat steps 3 and 4 until numB is 0 or negative value. enter code here
##     6. Prompt user to restart or terminate? y = restart n = terminate
##
## ERROR HANDLING:
##     None
##
## OTHER COMMENTS:
##     None
##################################################################

done = False
while not done:

    numA = input("Enter first integer: ") # 1. Get two whole numbers from user (A and B)
    numB = input("Enter second integer: ") # 1. Get two whole numbers from user (A and B)
    if numB &lt; 0:
        abs(numB) # 2. If user enters negative number for B convert to positive
    print'A = ',+ numA,'     ','B = ',+ numB
    def isodd(numB):
        return numB &amp; 1 and True or False
    while numB &amp; 1 == True:
        print'B is odd, add',+numA,'to product to get',+numA,\
        'A = ',+ numA,'     ','B = ',+numB,\
        'A = ',+ numA+numA,'     ','B = ',+ numB//2
    else:
            print'result is positive',\
            'Final product: ', +numA

    input = raw_input("Would you like to Start over? Y/N : ")
    if input == "N":
        done = True
</code></pre>
