Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixes broken solution
  • Loading branch information
ngiachou committed Jul 20, 2022
commit 2c9b49a077c4304f1e25da50ead7c0deac4e3a48
11 changes: 2 additions & 9 deletions project_euler/problem_027/sol1.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,10 @@ def is_prime(number: int) -> bool:
False
>>> is_prime(1)
False
>>> is_prime(3.14)
Traceback (most recent call last):
...
AssertionError: 'number' must been an int and positive
>>> is_prime(-10)
False
"""

# precondition
assert isinstance(number, int) and (
number >= 0
), "'number' must been an int and positive"

if 1 < number < 4:
# 2 and 3 are primes
return True
Expand Down