Loading, please wait...

Prime Number

To check whether a programme is prime number or not

 

Code:

 num=500
if num > 1:
   
   for i in range(2,num):
       if (num % i) == 0:
           print(num,"is not a prime number")
           print(i,"times",num//i,"is",num)
           break
   else:
       print(num,"is a prime number")
       

else:
   print(num,"is not a prime number")

 

Then click on the run button to execute it.