Added type hints and doctest for maths/prime_check. (#2367)

* Added type hints and doctest for maths/prime_check.

* Removed doctests.
This commit is contained in:
Björn Olsson Jarl 2020-08-29 17:11:02 +02:00 committed by GitHub
parent f2f0425357
commit ab5a046581
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ import math
import unittest
def prime_check(number):
def prime_check(number: int) -> bool:
"""
Check to See if a Number is Prime.
@ -42,7 +42,7 @@ class Test(unittest.TestCase):
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."