We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bda319b commit 4893a27Copy full SHA for 4893a27
1 file changed
find_prime_position.py
@@ -0,0 +1,21 @@
1
+def isPrime(n):
2
+ # Corner case
3
+ if (n <= 1):
4
+ return False
5
+
6
+ # Check from 2 to n-1
7
+ for i in range(2, n):
8
+ if (n % i == 0):
9
10
11
+ return True
12
13
14
+# Driver Program
15
+mas = input("number please:")
16
+count = 0
17
18
+for i in range(0,int(mas)+2):
19
+ if isPrime(i):
20
+ count = count + 1
21
+ print(str(i) + " is the " + str(count) + " Prime number")
0 commit comments