mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
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:
parent
f2f0425357
commit
ab5a046581
@ -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."
|
||||
|
Loading…
Reference in New Issue
Block a user