mirror of
https://github.com/flancian/garden.git
synced 2026-08-07 15:06:19 +00:00
autopushed
This commit is contained in:
+2
-2
@@ -17,7 +17,7 @@ def factor(n):
|
|||||||
click.echo(f"Is {i} a factor of {n}, I wonder?")
|
click.echo(f"Is {i} a factor of {n}, I wonder?")
|
||||||
|
|
||||||
def is_prime(n):
|
def is_prime(n):
|
||||||
SIEVE = [True for n in range(0, n+1)]
|
is_prime = [True for n in range(0, n+1)]
|
||||||
upto = math.ceil(math.sqrt(n))
|
upto = math.ceil(math.sqrt(n))
|
||||||
for i, _ in enumerate(is_prime):
|
for i, _ in enumerate(is_prime):
|
||||||
# click.echo(f"i: {i}")
|
# click.echo(f"i: {i}")
|
||||||
@@ -40,7 +40,7 @@ def is_prime(n):
|
|||||||
is_prime[i*j] = False
|
is_prime[i*j] = False
|
||||||
except IndexError:
|
except IndexError:
|
||||||
continue
|
continue
|
||||||
# click.echo(f"Sieve: {is_prime}.")
|
click.echo(f"Sieve: {is_prime}.")
|
||||||
return is_prime[n]
|
return is_prime[n]
|
||||||
|
|
||||||
class AgoraCmd(click.Command):
|
class AgoraCmd(click.Command):
|
||||||
|
|||||||
Reference in New Issue
Block a user