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 Falsedef 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?Thanks.
Python Prime Numbers Code Problem
primes
You don't get an empty list. See this. However you won't get the desired results because in python int divided by int is always int.  You may want to try this:import mathfactor_list = [ ]def integer_test(x):    if math.floor(x) == math.ceil(x):        return True    else:        return Falsedef factor_checker(x):    count = 0    y = x    while count <= y:        print(count)        count += 1        if integer_test(1.0 * x / count) == True:            factor_list.append(count)factor_checker(45)print(factor_list)In this code x/count is a double. So the integer_test will only return true if it's ceiling and floor return the same number i.e the integer itself.