def factors(num): """Get factors for given integer.""" result = set() for i in range(1, int(num ** 0.5) + 1): if num % i == 0: result.update({i, num // i}) return result