Create a program that asks the user for an integer greater than or equal to 100. Generate a list of primes up to and including this number. Print the list to the screen on a single line. You may assume that the user will enter valid numeric input in the correct range. how to do in python
def makeprimes( upper ): count = 2 primes = [1] while count <= upper: prime = True for i in range(2, count): if count % i == 0: prime = False break if prime: primes.append(count) count = count + 1 return primes
Quote:Create a program which displays primes numbers in sieve of eratosthenes
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)