Checking for empty number as input
<p>Consider this code:</p>

<pre><code>&gt;&gt;&gt; num = int(raw_input('Enter the number &gt; '))
</code></pre>

<p>If the user types nothing and presses 'Enter', I want to capture that. (Capture an empty input)</p>

<p>There are two ways of doing it:</p>

<ul>
<li>I do a simple <code>num = raw_input()</code>, then check whether <code>num == ''</code>. Afterwards, I can cast it to a <code>int</code>.</li>
<li>I catch a <code>ValueError</code>. But in that case, I can't differentiate between an non-numerical input and a empty input.</li>
</ul>

<p>Any suggestions on how to do this?</p>
