About 1,010,000 results
Open links in new tab
  1. Generate and print first N prime numbers - GeeksforGeeks

    Jul 23, 2025 · Approach 2: Below code also generates the first N prime numbers, but it is more efficient than the previous code because it only checks odd numbers after 2, and only checks them for …

  2. To find first N prime numbers in python - Stack Overflow

    Oct 27, 2009 · I am new to the programming world. I was just writing this code in python to generate N prime numbers. User should input the value for N which is the total number of prime numbers to print …

  3. Program to print prime numbers from 1 to N. - GeeksforGeeks

    Jul 12, 2025 · First, take the number N as input. Then use a for loop to iterate the numbers from 1 to N Then check for each number to be a prime number. If it is a prime number, print it. Approach 1: Print …

  4. How to Print Prime Numbers from 1 to N in Python?

    Feb 9, 2026 · Print Prime Numbers from 1 to N in Python Now, let me show you how to print prime numbers from 1 to n in Python using various methods with examples. Method 1: Basic Iteration and …

  5. Check Prime Number in Python - GeeksforGeeks

    Oct 11, 2025 · Given a positive integer N, the task is to write a Python program to check if the number is Prime or not in Python. For example, given a number 29, it has no divisors other than 1 and 29 itself. …

  6. Python Program to Print all Prime Numbers in an Interval

    Source code to print all prime numbers between two numbers enterd by user in Python programming with output and explanation...

  7. Print series of prime numbers in python - Stack Overflow

    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.

  8. Python Program to Print all Prime numbers in an Interval

    Oct 21, 2025 · The Task is to print all prime numbers in a given range by taking a starting and ending number as input. A prime number is a number greater than 1 that has no divisors other than 1 and …

  9. Python Program to Check Prime Number

    You can change the value of variable num in the above source code to check whether a number is prime or not for other integers. In Python, we can also use the for...else statement to do this task without …

  10. Python prime number generator using generators - w3resource

    Apr 24, 2025 · Learn how to create a generator function in Python that generates all prime numbers between two given numbers. Explore the power of generators in generating prime numbers efficiently.