Python if and elif not working, giving error
<p>I'm new in Python and doing an online tutorial. I have an assignment that I can not accomplish. My problem is that when I run this code, the <code>minimum</code> variable stays the same to <code>None</code> and does not record the new value input.</p>

<pre><code>maximum = None
minimum = None
while True:
    try:
        num2 = raw_input('Type here ')
        if num2 == 'done':break
        else:
            num = int(num2)
            if num &lt;= minimum:
                minimum = num
                print minimum
            elif num &gt;= maximum:
                maximum = num
                print maximum


    except:
        print 'Invalid Entry'


print 'Maximum is %d' % maximum
print 'Minimum is %d' % minimum
</code></pre>

<pre><code>import sys
maximum = None
minimum = sys.maxsize
while True:
    try:
        num2 = raw_input('Type here ')
        if num2 == 'done':break
        else:
            num = int(num2)
            minimum = min(minimum, num)
            maximum = max(maximum, num)
    except:
        print 'Invalid Entry'


if maximum is None:
    minimum = None

print 'Maximum is %d' % maximum
print 'Minimum is %d' % minimum
</code></pre>

python python-2.7 if-statement