Python: printing result of multiple inputs
<p>I'm pretty new to python programming, but i'm trying to write a program that goes as follows:</p>

<p>First: the program asks the user for a fixed number.
Then: the user can input as many numbers as he wants, until he writes "stop".
(this is not really where i'm having trouble)</p>

<p>the output needs to be something like this:
'fixed number'
'input #1 = fixed number + first inputted number'
'input #2 = fixed number + first inputted number + second inputted
number'
'an so on until all inputted numbers have been added'</p>

<p>my code doesn't print this out correctly, it prints the correct #1, #2, #n
but not the summation i listed above.</p>

<p>Any help is appreciated</p>

<p>Here is my code at this moment:</p>

<pre><code>random_number = int(input("Enter random number:"))
count_added = 0

while number != "stop":
    number = input("Enter number: ")

    if number == "stop":
        break
    else:
        number_int = int(number) 
        count_added += 1

    sum = number_int + random_number 

print(random_number)    

for x in range(1, count_added + 1): 
    print("input #{} is sum {} ".format(x, sum))
</code></pre>

<pre><code>random_number = int(input("Enter random number:"))
number_list = [random_number]
flag = True

while flag:
    try:
        number = int(input("Enter number: "))
        number_list.append(number)
    except:
        # if not a number, break the loop
        flag = False

print random_number

for i in range(1, len(number_list)):
    print "Input #%d is sum %d" \
            %(number_list[i], sum(number_list[:i+1]))
</code></pre>

python loops sum