From 24e97f532be927208bbfc92d9df529e3f1aeb7c5 Mon Sep 17 00:00:00 2001 From: Sindhuja Golagani Date: Mon, 5 Jan 2026 20:27:18 +0530 Subject: [PATCH 1/5] Change greeting from 'Hello' to 'Hello Sindhu' --- Programs/P01_hello.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Programs/P01_hello.py b/Programs/P01_hello.py index 5754bc3..96fa755 100644 --- a/Programs/P01_hello.py +++ b/Programs/P01_hello.py @@ -6,4 +6,4 @@ def justPrint(text): print(text) if __name__ == '__main__': - justPrint('Hello') + justPrint('Hello Sindhu') From a238d79eb84709ff80c117d50646fedd283c827b Mon Sep 17 00:00:00 2001 From: Sindhuja-G Date: Fri, 30 Jan 2026 17:15:07 +0530 Subject: [PATCH 2/5] Sum --- .appmodconfig | 0 Programs/P01_hello.py | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .appmodconfig diff --git a/.appmodconfig b/.appmodconfig new file mode 100644 index 0000000..e69de29 diff --git a/Programs/P01_hello.py b/Programs/P01_hello.py index 96fa755..73448f3 100644 --- a/Programs/P01_hello.py +++ b/Programs/P01_hello.py @@ -4,6 +4,10 @@ def justPrint(text): '''This function prints the text passed as argument to this function''' print(text) + a=10 + b=20 + c=a+b + print(c) if __name__ == '__main__': - justPrint('Hello Sindhu') + justPrint('Hello Sindhuja') From 8a807789fa5816fef37c854408021eb3afa30571 Mon Sep 17 00:00:00 2001 From: Sindhuja-G Date: Fri, 30 Jan 2026 19:17:22 +0530 Subject: [PATCH 3/5] Sub operation --- Programs/P01_hello.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Programs/P01_hello.py b/Programs/P01_hello.py index 73448f3..f36c64c 100644 --- a/Programs/P01_hello.py +++ b/Programs/P01_hello.py @@ -7,7 +7,9 @@ def justPrint(text): a=10 b=20 c=a+b - print(c) + d=b-a + print(c,d) if __name__ == '__main__': justPrint('Hello Sindhuja') + justPrint('Welcome to Python Programming') \ No newline at end of file From 97fd83f20839683c4aed6165577e3c0fd0549abd Mon Sep 17 00:00:00 2001 From: Sindhuja-G Date: Fri, 30 Jan 2026 21:03:31 +0530 Subject: [PATCH 4/5] Add operation --- Programs/P01_hello.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Programs/P01_hello.py b/Programs/P01_hello.py index f36c64c..82c9b60 100644 --- a/Programs/P01_hello.py +++ b/Programs/P01_hello.py @@ -8,7 +8,8 @@ def justPrint(text): b=20 c=a+b d=b-a - print(c,d) + e=c+d + print(c,d,e) if __name__ == '__main__': justPrint('Hello Sindhuja') From 5fcbbce8b9963611dcf3e5270fbaa6b93d27251c Mon Sep 17 00:00:00 2001 From: Sindhuja Golagani Date: Mon, 2 Feb 2026 19:40:01 +0530 Subject: [PATCH 5/5] Add LoginSystem class for user authentication Implement a login system with email and password validation, including account lockout after 3 failed attempts. --- Programs/login.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Programs/login.py diff --git a/Programs/login.py b/Programs/login.py new file mode 100644 index 0000000..34ab7d2 --- /dev/null +++ b/Programs/login.py @@ -0,0 +1,32 @@ +class LoginSystem: + def __init__(self): + self.valid_email = "user@test.com" + self.valid_password = "Password@123" + self.failed_attempts = 0 + self.locked = False + + def login(self, email, password): + if self.locked: + return "Account is locked. Contact support." + + if email == self.valid_email and password == self.valid_password: + self.failed_attempts = 0 + return "Login Successful ✅" + + else: + self.failed_attempts += 1 + + if self.failed_attempts >= 3: + self.locked = True + return "Account locked due to 3 failed attempts ❌" + + return f"Invalid credentials. Attempts left: {3 - self.failed_attempts}" + +# ----- Testing the function ----- + +app = LoginSystem() + +print(app.login("wrong@test.com", "123")) # Test case 1 +print(app.login("wrong@test.com", "123")) # Test case 2 +print(app.login("wrong@test.com", "123")) # Test case 3 (locks account) +print(app.login("user@test.com", "Password@123")) # Should fail because account is locked