Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions prime.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
'''
A Programme to find whether a number
is prime or not
'''
# Function to check prime
def prime_checker(user_input):
if user_input > 1:
if user_input == 2:
print('Prime')
elif user_input != 2:
for i in range(2, user_input):
if user_input % i == 0:
print('Not Prime')
else:
print('Prime')
else:
print('Not Prime nor Composite')

# Take the input from the User
user_input = int(input('Enter the Number\n'))

# Call Prime Checker Function
prime_checker(user_input)