Skip to content

Commit a1389a2

Browse files
committed
Add PrimeNumberCheck
Effecient Prime Number Checking Application
1 parent e963e1c commit a1389a2

File tree

3 files changed

+81
-25
lines changed

3 files changed

+81
-25
lines changed

.idea/dictionaries/kunal.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 49 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PrimeNumberCheck.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
def cmaker():
2+
print("Would You Like To Run The Program? Y or N?")
3+
choice = input()
4+
if "y" in choice or "Y" in choice or "yes" in choice:
5+
main()
6+
if "n" in choice or "N" in choice or "no" in choice:
7+
print("Thank you For Using This Application")
8+
exit()
9+
else:
10+
print("Err..Wrong Input Mate! Try Again Yes or No? Y or N?")
11+
cmaker()
12+
13+
14+
def main():
15+
print("Enter The No You Would Like To Check")
16+
number = int(input())
17+
# Check if greater than 1
18+
if number > 1:
19+
for i in range(2, number):
20+
if (number % i) == 0:
21+
print("The Number is not a Prime")
22+
print(i, "times", number // i, "is", number)
23+
break
24+
else:
25+
print("The Number is Prime ")
26+
break
27+
else:
28+
print("Number is not Prime")
29+
cmaker()
30+
31+
cmaker()

0 commit comments

Comments
 (0)