Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

prime number in python

start_num , end_num = input("enter 2 number sepreted by ,:").split(",")
start_num , end_num = int(start_num) , int(end_num)

for number in range(start_num , end_num+1):
    is_prime = True
    for counter in range(2,number):
        value = number % counter
        if value == 0:
            is_prime = False
            break
    if is_prime == True:
        print(number)
Source by www.sanfoundry.com #
 
PREVIOUS NEXT
Tagged: #prime #number #python
ADD COMMENT
Topic
Name
6+4 =