mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-03 21:38:40 +00:00
Fixes on isprothnumber()
This commit is contained in:
parent
941efc3a38
commit
8776dd6d0d
@ -63,15 +63,15 @@ def isprothnumber(number: int) -> bool:
|
|||||||
"""
|
"""
|
||||||
:param number: nth number to calculate in the sequence
|
:param number: nth number to calculate in the sequence
|
||||||
:return: true if number is a Proth number, false etherwise
|
:return: true if number is a Proth number, false etherwise
|
||||||
>>> proth(5)
|
>>> isprothnumber(5)
|
||||||
true
|
true
|
||||||
>>> proth(34)
|
>>> isprothnumber(34)
|
||||||
false
|
false
|
||||||
>>> proth(-1)
|
>>> isprothnumber(-1)
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
ValueError: Input value of [number=-1] must be > 0
|
ValueError: Input value of [number=-1] must be > 0
|
||||||
>>> proth(6.0)
|
>>> isprothnumber(6.0)
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
TypeError: Input value of [number=6.0] must be an integer
|
TypeError: Input value of [number=6.0] must be an integer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user