Python code won't run?
<p>Hello i was wondering why this code will not run,thanks.</p>

<pre><code>count = 0
finished = False
total = 0
while not finished:
    number = int(input("Enter a number(0 to finish)"))
    if number == 0:
        finished = True
        else:
            total = total + number
            count = count + 1
print("the average is", total/ count)
count = 0
</code></pre>

<p>It does run, the only issue I can see is that your else is indented inside your if block. In Python, indentation is important in a way that curled brackets or keywords are important in other programming languages.</p>

<pre><code>count = 0
finished = False
total = 0
while not finished:
    number = int(input("Enter a number(0 to finish)"))
    if number == 0:
        finished = True
    else:
        total = total + number
        count = count + 1
print("the average is", total/ count)
count = 0
</code></pre>

python python-3.x