-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisprime.py
26 lines (23 loc) · 912 Bytes
/
isprime.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
"""Checking if how many numbers are prime"""
def isPrime(x):
prime_numbers=[2,3]
start_point = 4
#--------------------------------------------------------------------
#--------------------------------------------------------------------
#--------------------------------------------------------------------
#--------------------------------------------------------------------
#--------------------------------------------------------------------
while True:
for number in range(2,(start_point//2)+1):
#--------------------------------------------------------------------
#--------------------------------------------------------------------
if start_point % number == 0:
break
#--------------------------------------------------------------------
else:
prime_numbers.append(start_point)
start_point+=1
if len(prime_numbers) == x:
break
return str(prime_numbers)
print(isPrime(100))