Ali Satwat KhanChristian Clausspre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
eea1bacfe0 fix: raise ValueError in encode() for non-lowercase input (#14936)
* fix: raise ValueError in encode() for non-lowercase input

encode() previously accepted uppercase letters, digits, and other
non-lowercase characters silently, producing incorrect/out-of-range
values (e.g. negative numbers for uppercase letters) instead of
failing. Add input validation using str.islower() and str.isalpha()
to raise a ValueError when the input isn't purely lowercase a-z.
Added a doctest covering the new error case.

* resolved doctest

* Fix Ruff 0.16 lint failures

* Enhance encode function error handling examples

Update error handling in encode function to include examples for mixed case and invalid characters.

* Fix indentation in test_cancer_data function

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

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

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-07-31 18:07:20 +02:00
2024-09-30 23:01:15 +02:00
2025-07-06 01:35:29 +03:00
2023-10-03 14:47:10 +05:30
2022-07-23 07:56:59 +05:30
2025-08-30 13:11:57 +03:00

The Algorithms - Python

Gitpod Ready-to-Code Contributions Welcome Discord chat Gitter chat
GitHub Workflow Status pre-commit code style: black

All algorithms implemented in Python - for education 📚

Implementations are for learning purposes only. They may be less efficient than the implementations in the Python standard library. Use them at your discretion.

🚀 Getting Started

📋 Read through our Contribution Guidelines before you contribute.

🌐 Community Channels

We are on Discord and Gitter! Community channels are a great way for you to ask questions and get help. Please join us!

📜 List of Algorithms

See our directory for easier navigation and a better overview of the project.

Languages
Python 99.8%
Shell 0.2%