codeNUMBEROFPRIMES = 100 NUMBEROFPRIMESPERLINE = 10 count = 0 number = 2 while (count < NUMBEROFPRIMES): isPrime = True divisor = int divisor = 2 for divisor in range(2,int(number/2)): If (number % divisor) == 0 isPrime = False break if isPrime: count = count + 1 print(number) if (count % NUMBEROFPRIMESPERLINE) == 0: print(number/n) number = number + 1what is wrong with code?
Convert Vba Primes to Python Primes
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Need help to identify Mersenne Primes, I do need a search pattern. | Pleiades | 0 | 2,594 |
Dec-03-2019, 11:05 PM Last Post: Pleiades |
|
Sophie Germain Primes | PythonLamer | 7 | 7,196 |
Oct-28-2017, 05:27 AM Last Post: heiner55 |
Users browsing this thread: 1 Guest(s)