x = int(input())
for i in range(2,x):
if(x % i ==0):
print("not Prime")
break
else :
print("Prime")
In this example, I am asking the user to input a value for x. So let's say the user inputs 6 since it is not a prime number, it will say "not Prime." However, I want to ask the user to input another value to check.
x = int(input())
for i in range(2,x):
if(x % i ==0):
print("not Prime")
break
else :
print("Prime")
x = int(input())
Doing this does not work. so what can I do to ask the user to input another value? without having to run it again?
