From 61305d3170eed65883ab0a0570f98078ea950eba Mon Sep 17 00:00:00 2001 From: Raj Chandanshive Date: Sun, 25 Oct 2026 21:40:48 +0530 Subject: [PATCH] Fixes #15633 Added a guard to alternative_password_generator to raise ValueError when the required characters exceed the requested password length. --- other/password.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/other/password.py b/other/password.py index 6b64bdb4d81a..6ef8f8c9d5fa 100644 --- a/other/password.py +++ b/other/password.py @@ -29,6 +29,8 @@ def alternative_password_generator(chars_incl: str, i: int) -> str: # Password Generator = full boot with random_number, random_letters, and # random_character FUNCTIONS # Put your code here... + if i < len(chars_incl): + raise ValueError("Required characters exceed the requested password length") i -= len(chars_incl) quotient = i // 3 remainder = i % 3