Skip to content

Fix invalid escape sequence in binary_search_tree.py #1920

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ciphers/a1z26.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,28 @@
http://bestcodes.weebly.com/a1z26.html
"""


def encode(plain: str) -> list:
"""
>>> encode("myname")
[13, 25, 14, 1, 13, 5]
"""
return [ord(elem) - 96 for elem in plain]


def decode(encoded: list) -> str:
"""
>>> decode([13, 25, 14, 1, 13, 5])
'myname'
"""
return "".join(chr(elem + 96) for elem in encoded)


def main():
encoded = encode(input("->").strip().lower())
print("Encoded: ", encoded)
print("Decoded:", decode(encoded))


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion data_structures/binary_tree/binary_search_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def postorder(curr_node):


def binary_search_tree():
"""
r"""
Example
8
/ \
Expand Down
2 changes: 1 addition & 1 deletion digital_image_processing/test_digital_image_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_sepia():
assert sepia.all()


def test_burkes(file_path: str="digital_image_processing/image_data/lena_small.jpg"):
def test_burkes(file_path: str = "digital_image_processing/image_data/lena_small.jpg"):
burkes = bs.Burkes(imread(file_path, 1), 120)
burkes.process()
assert burkes.output_img.any()