Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python program to find n prime numbers

num = 10
for i in range(2,num+1):
    for j in range(2,i):
        if(i%j == 0):
            break
    else:
        print(i)
Comment

prime numbers upto n in python

lower = int(input("Enter lower range: "))  
upper = int(input("Enter upper range: "))  
  
for num in range(lower,upper + 1):  
   if num > 1:  
       for i in range(2,num):  
           if (num % i) == 0:  
               break  
       else:  
           print(num)  
Comment

PREVIOUS NEXT
Code Example
Python :: pandas pivot tables 
Python :: add vertical line in plot python 
Python :: count in python 
Python :: Python DateTime Class Syntax 
Python :: install pyimagesearch python3 
Python :: How to Remove Items in a Set in Python Using the discard() Method 
Python :: is there a null data type in python 
Python :: double underscore methods python 
Python :: logger 
Python :: How to use Counter() Function 
Python :: loops in python 
Python :: linkedlist python 
Python :: giving number of letter in python 
Python :: what is django python 
Python :: binary search in python 
Python :: replace in python 
Python :: convert a list to tuple 
Python :: List Get a Element 
Python :: itertools count 
Python :: change the format of date in python 
Python :: how to separate numeric and categorical variables in python 
Python :: rgb to hex python 
Python :: list dataframe to numpy array 
Python :: python minimum 
Python :: django model 
Python :: python file 
Python :: TypeError: create_superuser() missing 1 required positional argument: 
Python :: aws s3 sync boto3 
Python :: .extend python 
Python :: generating random numbers numpy 
ADD CONTENT
Topic
Content
Source link
Name
8+4 =