Hey guys. I wanted to create a prime numbers generator. This is how the program looks at the moment:
So I would love it, if you could have a look for the program and tell me what mistake I have made.
Greets, ixaM
PS: You may have found some vocabulary or grammaticly mistakes in the text. Keep them with u :) I am not from an englishspeaking country, so yeah, my english is kinda bad. :(
from decimal import * PRIMES = [2] p = 3 n = 2 x = int(input("Until which number do you want to know the primes?")) while True: if p/n == int(p/n) and p/n != 1.0: p = p+1 if p/n != int(p/n): n = n+1 if p/n == 1: PRIMES.append(p) p = p+1 n = 2 if p > x: break print(PRIMES)the program works okay, but it says, that some numbers are primes, which are just no primes. (For example 27)
So I would love it, if you could have a look for the program and tell me what mistake I have made.
Greets, ixaM
PS: You may have found some vocabulary or grammaticly mistakes in the text. Keep them with u :) I am not from an englishspeaking country, so yeah, my english is kinda bad. :(