एक फंक्शन लिखिए, जो यह पता लगाता हो कि कोई संख्या प्राइम है या नहीं। यदि संख्या प्राइम है तो फंक्शन को 1 हटाना चाहिए नहीं तो o लौटाना। चाहिए।
Answers
Answered by
1
Answer:
num = 11
if num > 1:
for i in range(2, num//2):
if (num % i) == 0:
print(num, "is not a prime number")
break
else:
print(num, "is a prime number")
else:
print(num, "is not a prime number")
Output:
11 is a prime number
Explanation:
hope it helps u
:)
Similar questions
English,
4 months ago
Hindi,
4 months ago
Science,
4 months ago
Computer Science,
9 months ago
Computer Science,
9 months ago
Science,
1 year ago
History,
1 year ago
Hindi,
1 year ago