How to resolve modulus/division by zero error in python : <p>I am struggling to debug the following code, which throws a ZeroDivisionError:</p>

<pre><code>if num &gt; 0:
    return filter(lambda x: abs(num) % x == 0, range(1:abs(num))
else:
    pass
</code></pre>

<p>The error message is: </p>

<pre><code>ZeroDivisionError: integer division or modulo by zero
</code></pre>

<p>The code is a bit ugly because I was getting this error before adding the if and abs() statements.</p>

<p>I am using python 3.6 per my schools requirement, and the task is to return factors of int <code>num</code> using a filter. </p>
