mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-23 01:28:26 +00:00
Compare commits
1 Commits
67a1b5e526
...
dda3a9f4f1
Author | SHA1 | Date | |
---|---|---|---|
|
dda3a9f4f1 |
|
@ -16,13 +16,13 @@ repos:
|
||||||
- id: auto-walrus
|
- id: auto-walrus
|
||||||
|
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.9.3
|
rev: v0.9.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
|
|
||||||
- repo: https://github.com/codespell-project/codespell
|
- repo: https://github.com/codespell-project/codespell
|
||||||
rev: v2.4.0
|
rev: v2.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: codespell
|
- id: codespell
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
|
|
|
@ -88,7 +88,7 @@ def __prepare(
|
||||||
...
|
...
|
||||||
KeyError: 'Length of alphabet has to be 27.'
|
KeyError: 'Length of alphabet has to be 27.'
|
||||||
|
|
||||||
Testing with punctuation not in the given alphabet
|
Testing with punctuations that are not in the given alphabet
|
||||||
|
|
||||||
>>> __prepare('am i a boy?','abCdeFghijkLmnopqrStuVwxYZ+')
|
>>> __prepare('am i a boy?','abCdeFghijkLmnopqrStuVwxYZ+')
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
|
@ -128,7 +128,7 @@ def encrypt_message(
|
||||||
encrypt_message
|
encrypt_message
|
||||||
===============
|
===============
|
||||||
|
|
||||||
Encrypts a message using the trifid_cipher. Any punctuatuion chars that
|
Encrypts a message using the trifid_cipher. Any punctuatuions that
|
||||||
would be used should be added to the alphabet.
|
would be used should be added to the alphabet.
|
||||||
|
|
||||||
PARAMETERS
|
PARAMETERS
|
||||||
|
|
|
@ -221,10 +221,6 @@ def del_node(root: MyNode, data: Any) -> MyNode | None:
|
||||||
else:
|
else:
|
||||||
root.set_right(del_node(right_child, data))
|
root.set_right(del_node(right_child, data))
|
||||||
|
|
||||||
# Re-fetch left_child and right_child references
|
|
||||||
left_child = root.get_left()
|
|
||||||
right_child = root.get_right()
|
|
||||||
|
|
||||||
if get_height(right_child) - get_height(left_child) == 2:
|
if get_height(right_child) - get_height(left_child) == 2:
|
||||||
assert right_child is not None
|
assert right_child is not None
|
||||||
if get_height(right_child.get_right()) > get_height(right_child.get_left()):
|
if get_height(right_child.get_right()) > get_height(right_child.get_left()):
|
||||||
|
|
|
@ -159,7 +159,7 @@ lint.pylint.max-returns = 8 # default: 6
|
||||||
lint.pylint.max-statements = 88 # default: 50
|
lint.pylint.max-statements = 88 # default: 50
|
||||||
|
|
||||||
[tool.codespell]
|
[tool.codespell]
|
||||||
ignore-words-list = "3rt,abd,aer,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
|
ignore-words-list = "3rt,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
|
||||||
skip = "./.*,*.json,*.lock,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_names.txt,pyproject.toml,strings/dictionary.txt,strings/words.txt"
|
skip = "./.*,*.json,*.lock,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_names.txt,pyproject.toml,strings/dictionary.txt,strings/words.txt"
|
||||||
|
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
|
|
|
@ -85,8 +85,6 @@ def bubble_sort_recursive(collection: list[Any]) -> list[Any]:
|
||||||
[1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7]
|
[1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7]
|
||||||
>>> bubble_sort_recursive([1, 3.3, 5, 7.7, 2, 4.4, 6])
|
>>> bubble_sort_recursive([1, 3.3, 5, 7.7, 2, 4.4, 6])
|
||||||
[1, 2, 3.3, 4.4, 5, 6, 7.7]
|
[1, 2, 3.3, 4.4, 5, 6, 7.7]
|
||||||
>>> bubble_sort_recursive(['a', 'Z', 'B', 'C', 'A', 'c'])
|
|
||||||
['A', 'B', 'C', 'Z', 'a', 'c']
|
|
||||||
>>> import random
|
>>> import random
|
||||||
>>> collection_arg = random.sample(range(-50, 50), 100)
|
>>> collection_arg = random.sample(range(-50, 50), 100)
|
||||||
>>> bubble_sort_recursive(collection_arg) == sorted(collection_arg)
|
>>> bubble_sort_recursive(collection_arg) == sorted(collection_arg)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user