is_prime I go back to do this but it can t get into the for loop . thank u


#1

import math
while True:
n=int(input("Please enter a number:"))
print(math.sqrt(n))

if n<2:
    print("It is not prime")
    
elif n==2:
    print("It is prime")
    break
elif n>2:
    for i in range(3,int(math.sqrt(n))):
        if n%i==0:
            print("It is not prime")
            
        elif n%i!=0 :
            print("It is prime")

            break

#2

@pythonmaster1031 try this

import math
while True:
    n=int(input("Please enter a number:"))
    print(math.sqrt(n))

    if n<2:
        print("It is not prime")

    else:
        for i in range(2,int(math.sqrt(n)+1)):
            print i
            if n%i==0:
                print("It is not prime")
            else:
                print("It is prime")
        break

Now I took out this line

because we handle it here