write a program to check whether the given number is a prime number or not in python
Answers
Answered by
8
Answer:
num = int(input("Enter a number: "))
if num > 1:
for i in range(2,num):
if (num % i) == 0:
print(num,"is not a prime number")
print(i,"times",num//i,"is",num)
break
else:
print(num,"is a prime number")
else:
print(num,"is not a prime number")
Explanation:
Hope this helps you :)
Similar questions
Social Sciences,
15 days ago
History,
15 days ago
English,
1 month ago
Environmental Sciences,
8 months ago
Math,
8 months ago