Print series of prime numbers in python
You need to check all numbers from 2 to n-1 (to sqrt(n) actually, but ok, let it be n). If n is divisible by any of the numbers, it is not prime. If a number is prime, print it. for num in range(2,101): prime = True for i in range(2,num): if (num%i==0): prime = False … Read more