From f955635d5da254864c6488777ada3d04394dd4b1 Mon Sep 17 00:00:00 2001 From: 3r1nC Date: Sun, 5 Oct 2025 00:11:00 +0000 Subject: [PATCH] Closes: #1 Updated validations.py python script Fixed the behavior of validate_user function in validations.py --- Course3/Lab4/validations.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Course3/Lab4/validations.py b/Course3/Lab4/validations.py index b18de65a2e..01986fb68e 100644 --- a/Course3/Lab4/validations.py +++ b/Course3/Lab4/validations.py @@ -18,7 +18,16 @@ def validate_user(username, minlen): # Usernames can't begin with a number if username[0].isnumeric(): return False + # Username must start with a letter + if username[0].isalpha() == False: + return False return True +print(validate_user("blue.kale", 3)) # True + +print(validate_user(".blue.kale", 3)) # Currently True, should be False + +print(validate_user("red_quinoa", 4)) # True +print(validate_user("_red_quinoa", 4)) # Currently True, should be False