Bad operand type for unary-:"str'
<p>New to Python and can't figure out what's wrong with the code below. </p>

<pre><code>a = input('input a number: ')
if int(a) &gt;=0:
    print(a)
else:
    print(-a)
</code></pre>

<p>When enter -2, the output should be 2.</p>

<p>However, I got a error code:</p>

<pre><code>TypeError: bad operand type for unary-:"str' on print(-a)
</code></pre>

<p>Can anyone help? Thanks.</p>