@Nathan2196/

Prime Number Generator

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
usernumber = 1
usernumberdivisible = 0
isitremainder = 0
a = int(1)
b = int(0)
z = 0
isprime = 0
userinfo = 0
userinfo = input("Press 'n' to enter a number to check for primeness or press 'enter' to generate a list of prime numbers")
if(userinfo == 'n'):
	isprime = int(input("Enter a number to check for primeness : "))
	
print("Here is a list of Prime Numbers : ")
while(1==1):
	usernumber = int(usernumber) + int(a)
	usernumberdivisible = int(usernumber)
	usernumberdivisible = int(usernumberdivisible) - int(a)
	b = int(0)
	while(b == 0):
		isitremainder = usernumber % usernumberdivisible
		if(isitremainder == 0):
			if(usernumberdivisible == 1):
				print(usernumber)
				b = 1
			else:
				b = 1
		else:
			usernumberdivisible = int(usernumberdivisible) - int(a)