I am struggling to debug the following code, which throws a ZeroDivisionError:
if num > 0:
return filter(lambda x: abs(num) % x == 0, range(1:abs(num))
else:
pass
The error message is:
ZeroDivisionError: integer division or modulo by zero
The code is a bit ugly because I was getting this error before adding the if and abs() statements.
I am using python 3.6 per my schools requirement, and the task is to return factors of int num
using a filter.