We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 495e254 commit 089c105Copy full SHA for 089c105
Prime_number.py
@@ -19,15 +19,14 @@ def is_prime_a(n):
19
20
21
def is_prime_b(n):
22
- if n > 1:
23
- if n == 2:
24
- return True
25
- else:
26
- for i in range(2, int(n//2)+1):
27
- if n % i == 0:
28
- return False
29
30
+ if n <= 1:
+ return False
+ if n == 2:
+ return True
+ for i in range(2, int(n//2)+1):
+ if n % i == 0:
31
32
33
def is_prime_c(n):
0 commit comments