Skip to content

Commit

Permalink
Added type hints and doctest for maths/prime_check. (#2367)
Browse files Browse the repository at this point in the history
* Added type hints and doctest for maths/prime_check.

* Removed doctests.
  • Loading branch information
frangiz authored Aug 29, 2020
1 parent f2f0425 commit ab5a046
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maths/prime_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import unittest


def prime_check(number):
def prime_check(number: int) -> bool:
"""
Check to See if a Number is Prime.
Expand Down Expand Up @@ -42,7 +42,7 @@ def test_primes(self):
def test_not_primes(self):
self.assertFalse(prime_check(-19), "Negative numbers are not prime.")
self.assertFalse(
prime_check(0), "Zero doesn't have any divider, primes must have two"
prime_check(0), "Zero doesn't have any divider, primes must have two."
)
self.assertFalse(
prime_check(1), "One just have 1 divider, primes must have two."
Expand Down

0 comments on commit ab5a046

Please sign in to comment.