From f649baf66ed6849059f98130bc8bc86a52e86114 Mon Sep 17 00:00:00 2001 From: D Bhoopesh sakthi sudhan Date: Sat, 14 Nov 2026 01:21:09 +0530 Subject: [PATCH] Fix password generator length validation Add validation for minimum password length requirement. --- other/password.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/other/password.py b/other/password.py index 6b64bdb4d81a..ac3dfe772c53 100644 --- a/other/password.py +++ b/other/password.py @@ -29,6 +29,10 @@ 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( + "Password length must be at least the number of required characters" + ) i -= len(chars_incl) quotient = i // 3 remainder = i % 3