I am trying to make a simple prime number detector base on user input. These code line down here I have input 2 and 5 and 123. Even though they are prime number but the program seems to print "not prime number" for any number you input
I have tried a lot but most of my code even didn't print anything.
def check_Prime(f):
if(f<2):
return False
can=math.sqrt(f)
for x in range(2,can):
if(f%x==0):
return False
else:
return True
if check_Prime is True:
print("prime number")
else:
print("not prime number")
I expect if you input a prime number then it will print("prime number") and if you didn't input prime number it will print the other one