From 8e5977801dd90d107fb8c7fea8b91752c4f8fbe7 Mon Sep 17 00:00:00 2001 From: Akhileswar Date: Sun, 26 Oct 2025 22:50:05 +0530 Subject: [PATCH 1/3] update practice --- 07_Practice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/07_Practice.py b/07_Practice.py index 734c931..cc73d96 100644 --- a/07_Practice.py +++ b/07_Practice.py @@ -6,7 +6,7 @@ # Print squares of numbers from 1 to n n = int(input("Enter a number:")) -for i in range(1,n): +for i in range(1,n+1): print(i**2) From 668c1203b93551cfbba36ef93f7ce63da8a3ebfc Mon Sep 17 00:00:00 2001 From: Akhileswar Date: Sun, 26 Oct 2025 23:01:57 +0530 Subject: [PATCH 2/3] update global_local file --- 09_Global_local.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/09_Global_local.py b/09_Global_local.py index d333112..55013f8 100644 --- a/09_Global_local.py +++ b/09_Global_local.py @@ -4,7 +4,7 @@ def greet(): print(msg) greet() - +"""print("Outside:", msg)""" # This will raise an error since msg is not defined outside the function # global variables msg = "Hello" @@ -16,11 +16,11 @@ def greet_global(): def fun(): - print("Inside Function", s) + print("Inside Function: ", s) s = "I love Geeksforgeeks" fun() -print("Outside Function", s) +print("Outside Function: ", s) # Modifying Global Variables Inside a Function @@ -30,4 +30,4 @@ def fun(): print(s) s = "I love Geeksforgeeks " fun() -print("Outside Function", s) +print("Outside Function: ", s) From 6fc593b6fbcbeb9f210a55a5059105773b3c3d02 Mon Sep 17 00:00:00 2001 From: Akhileswar Date: Sun, 26 Oct 2025 23:18:33 +0530 Subject: [PATCH 3/3] updated files --- 14_Decorators.py | 5 +++-- 15_Strings.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/14_Decorators.py b/14_Decorators.py index 6af1d83..798014c 100644 --- a/14_Decorators.py +++ b/14_Decorators.py @@ -40,7 +40,8 @@ def square(x): -# Types of Decorators +"""Types of Decorators""" + # 1. Function Decorators # Function decorators are used to modify or enhance the behavior of functions. def simple_decorator(func): @@ -86,7 +87,7 @@ def say_hello(self): obj.say_hello() -# Common Built-in Decorators in Python +"""Common Built-in Decorators in Python""" # @staticmethod class MathOperations: @staticmethod diff --git a/15_Strings.py b/15_Strings.py index 11a963b..d333903 100644 --- a/15_Strings.py +++ b/15_Strings.py @@ -16,7 +16,7 @@ print(str4.strip()) # Remove leading and trailing spaces print(str3.replace("Venkateswara", "College")) # Replace substring print(str3.split()) # Split into a list of words -print(str3.find("a")) # Find the index of a substring +print(str3.find("a")) # Find the first occurence index of a substring print(str3.index("Venkateswara")) # Find the index of a substring (raises error if not found) print(str3.count("a")) # Count occurrences of a character print(str3.startswith("Ven")) # Check if string starts with a substring