Can't kick out of while loop
<pre><code>#Fiery Elsa
#ID:899525
#Homework 2, Program 2


#Initialization
count=0
name=input("Enter stock name OR -999 to Quit:")

#Input
while name!=-999:
    count=count+1
    name=input("Enter stock name OR -999 to Quit:")
    shares=int(input("Enter number of shares:"))
    pp=float(input("Enter purchase price:"))
    sp=float(input("Enter selling price:"))
    commission=float(input("Enter commission:"))


#Calculations
amount_paid=shares*pp
commission_paid_purchase=amount_paid*commission
amount_sold=shares*sp
commission_paid_sale=amount_sold*commission
profit_loss=(amount_sold - commission_paid_sale) -(amount_paid + commission_paid_purchase)

#Output
print("Stock Name:", name)
print("Amount paid for the stock:       $", format(amount_paid, '10,.2f'))
print("Commission paid on the purchase: $", format(commission_paid_purchase, '10,.2f'))
print("Amount the stock sold for:       $", format(amount_sold, '10,.2f'))
print("Commission paid on the sale:     $", format(commission_paid_sale, '10,.2f'))
print("Profit (or loss if negative):    $", format(profit_loss, '10,.2f'))
</code></pre>

<p>Program loops, but doesn't kick out to print output when you press -999. What am I doing wrong?</p>

<p>Ideally, the program should allow the user to input as many times as he/she wants until the user is done. For example: 3 sets of inputs resulting in 3 sets of outputs. </p>

<p>You need to evaluate the value of name after each input.</p>

<pre><code>stock_name = []   # make a list for stock name
shares = []   # change also all other input variables into list type

while True:   # this will allow you to loop the input part
    name = input()
    if name != '-999':  # this will evaluate the value of name
        stock_name.append(name)  # this will add your latest name input to the list
        # Do the same to your other inputs
    else:
        break  # exit your while loop

# you need another loop here to do calculations and output
# I think this is where your count variable should go to index your lists
</code></pre>

python python-3.x while-loop