mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 18:38:39 +00:00
error in exit 1
This commit is contained in:
parent
25921bd37c
commit
7e9f2afa8e
@ -19,7 +19,7 @@ def octal_to_binary(octal_number: str) -> str:
|
|||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
ValueError: Non-octal value was passed to the function
|
ValueError: Non-octal value was passed to the function
|
||||||
|
|
||||||
>>> octal_to_binary("@#")
|
>>> octal_to_binary("@#")
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
...
|
...
|
||||||
@ -30,7 +30,7 @@ def octal_to_binary(octal_number: str) -> str:
|
|||||||
ValueError: Empty string was passed to the function
|
ValueError: Empty string was passed to the function
|
||||||
"""
|
"""
|
||||||
if not octal_number:
|
if not octal_number:
|
||||||
raise ValueError("Empty String was passed to the function")
|
raise ValueError("Empty string was passed to the function")
|
||||||
|
|
||||||
binary_number = ""
|
binary_number = ""
|
||||||
octal_digits = "01234567"
|
octal_digits = "01234567"
|
||||||
@ -50,5 +50,4 @@ def octal_to_binary(octal_number: str) -> str:
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import doctest
|
import doctest
|
||||||
|
|
||||||
doctest.testmod()
|
doctest.testmod()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user