function that finds how many times n can be divided in half
<p>Basically, I need a function that will divide n by 2 and return the number of times it can be done.</p>

<p>Coding so far:</p>

<pre><code>def div(n):
    while n &gt;= 0:
        n / 2
    return n
</code></pre>

<p>I know for a fact that I have to use the while loop but I'm not confident in my third line of coding. Can someone tell me what I'm doing wrong?</p>

<p>examples:</p>

<pre><code>&gt;&gt;&gt; div(4)
2
&gt;&gt;&gt; div(7)
2
</code></pre>
