Doctest Error Correction of mirror_formulae.py (#9782)

* Python mirror_formulae.py is added to the repository

* Changes done after reading readme.md

* Changes for running doctest on all platforms

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Change 2 for Doctests

* Changes for doctest 2

* updating DIRECTORY.md

* Doctest whitespace error rectification to mirror_formulae.py

* updating DIRECTORY.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
Vipin Karthic 2023-10-05 13:18:15 +05:30 committed by GitHub
parent 4b6301d4ce
commit 0d324de7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -469,6 +469,7 @@
* [Djb2](hashes/djb2.py)
* [Elf](hashes/elf.py)
* [Enigma Machine](hashes/enigma_machine.py)
* [Fletcher16](hashes/fletcher16.py)
* [Hamming Code](hashes/hamming_code.py)
* [Luhn](hashes/luhn.py)
* [Md5](hashes/md5.py)

View File

@ -66,7 +66,7 @@ def focal_length(distance_of_object: float, distance_of_image: float) -> float:
>>> from math import isclose
>>> isclose(focal_length(9.5, 6.7), 3.929012346)
True
>>> focal_length(0, 20)
>>> focal_length(0, 20) # doctest: +NORMALIZE_WHITESPACE
Traceback (most recent call last):
...
ValueError: Invalid inputs. Enter non zero values with respect
@ -89,7 +89,7 @@ def object_distance(focal_length: float, distance_of_image: float) -> float:
>>> from math import isclose
>>> isclose(object_distance(10.5, 11.7), 102.375)
True
>>> object_distance(90, 0)
>>> object_distance(90, 0) # doctest: +NORMALIZE_WHITESPACE
Traceback (most recent call last):
...
ValueError: Invalid inputs. Enter non zero values with respect
@ -112,7 +112,7 @@ def image_distance(focal_length: float, distance_of_object: float) -> float:
>>> from math import isclose
>>> isclose(image_distance(1.5, 6.7), 1.932692308)
True
>>> image_distance(0, 0)
>>> image_distance(0, 0) # doctest: +NORMALIZE_WHITESPACE
Traceback (most recent call last):
...
ValueError: Invalid inputs. Enter non zero values with respect