While loop isn't looping : <p>I have a while loop which I would like to keep prompting a user to enter a number until the user types "exit". Unfortunately when the user enters anything, they aren't prompted to enter another number, and the procedure doesn't end. I'm using Pycharm as my IDE. Here is my code:</p>

<pre><code>a = []
num = ""
newa = []
def makelist():
    num = input("Type a number! Or if you want to exit, type 'exit' ")
    while num != "exit":
        if int(num):
            a.append(num)
        num
def firstandlast():
    newa.append(a[0]) and newa.append([len(a)])
    print("Here are the first and last numbers you typed:")
    print(newa)
makelist()
firstandlast()
</code></pre>
