``````So my code to test a prime number is as follows:

PrimeTest():
test = input ( "What number would you like to test? " )
test = int(test)

true = 0
divisor = 0

for divisor in range (2, 10):
if ( (isinstance( test/divisor, int )== True) &  (test/divisor == int < 2) ):
print ("This number is divisible by " + str(divisor) )

if ( (test != divisor) & (isinstance( test/divisor, int)== False) ):
true = true + 1
if ( true == 8 ):
print ("This number is prime.")

PrimeTest()
``````

The value output always have a float type, even though it is an interger (i.e. 2.0). How do I fix that?

I get errors on lines 3, 11, and 14 so I can't get any output to test for a float.

what version do you have? I have 34

Is not syntax error but does not make any kind of sense ot do bitwise arithmetic with boolean:

``````(isinstance( test/divisor, int )== True) &  (test/divisor == int < 2)
``````

You should be using `%` (modulus operator or remainder) and integer values.

kind

Is not syntax error but does not make any kind of sense ot do bitwise arithmetic with boolean:

reason for that is that I need it to be an interger and not a float, because you need to test if the number is divisible by a whole number. Ex. (4/5 != int) but (5/5 = int = true) Make sense?

No, it does not, 4/5 is float number and int is of type 'type', the other formula of yours is assignment syntax error.

So how do I change that without messing up the function?

``````def prime_test():
test = int(input("What number would you like to test? "))
assert 0 < test < 11 * 11
for divisor in range(2, 8): #highest prime under eleven is 7
if divisor < test and test % divisor == 0:
print("This number is divisible by " + str(divisor))
break
else:
print('This number is prime')

prime_test()
``````

By the way, this test is also supposed to test what a number is divisible by so that is part of the reason why it is not simpler.