Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

prime number in python

prime=int(input("Enter a number:"))
buffer=0
for i in range(2,prime):
    if prime%i==0:
        print(prime," is not a prime number")
        buffer=1
        break
if buffer==0:
    print(prime," is a prime number")
Source by studyglance.in #
 
PREVIOUS NEXT
Tagged: #prime #number #python
ADD COMMENT
Topic
Name
6+6 =