I was trying to write my own code for primes in Python. I know that code already exists, but I am doing this to challenge my knowledge and make my own solution. I was wondering if any of you guys would tell me what's wrong with it.
factor_list = [ ] def integer_test(x): if type(x) == int: return True else: return False def factor_checker(x): count = 0 y = x while count <= y: print(count) count += 1 if integer_test(x / count) == True: factor_list.append(count) factor_checker(45) print(factor_list)
When I try to input a number for factor checker and then look at the factor list, I just get an empty list. What is wrong?