I am trying to write a function for checking if a number is prime or not and have written the below function. But though the function doesnt throw an error upon defining it , it doesnt execute when run with an input argument ( like say 23) . Have tried running it on Jupyter notebook where the kernel keeps running , as well as an online editor where i get the error "Error: Command failed: timeout 7 python3". Am unable to see possible issues such as division with 0 etc.Could you please help ?
def prime_check(num):
prime =True
while prime==True:
for i in range(2,num):
if num%i ==0:
prime=False
break
return prime