Python Developer Application & OOP Guide
Python Developer Application & OOP Guide
Dear Rakesh,
I hope you are doing well. am writing to express my
interest in the Fresher – Python Developer position at
Boston Technology Corporation (BTC). I have recently
completed my [Link] in Computer Science and
Engineering from Kalasalingam Academy of Research
and Education with CGPA 8.0 and have undergone
Python Full Stack Development training at Thopstech
Career Solutions Pvt. Ltd., where I gained hands-on
experience working on real-time projects.
Best regards,
Chandeshwer Reddy Chintham
Bengaluru
+91 8374753946
chandeswer9567@[Link] ᐧ
Here is a polished and modified version suited for Application for Graduate Hiring
Program:
Dear Rakesh,
[Link] 1/39
11/9/25, 10:31 PM Application modification
Academy of Research and Education with a CGPA of 8.0. I have also undergone Python
Full Stack Development training at Thopstech Career Solutions Pvt. Ltd., where I
gained hands-on experience working on real-time projects.
Thank you for your time and consideration. I look forward to the opportunity to
contribute and grow with BTC.
Best regards,
Chandeshwer Reddy Chintham
Bengaluru
+91 8374753946
chandeswer9567@[Link]
If you'd like, I can also format this into a more formal email template or create a
version tailored to HR screening.
✅ Example:
python Copy code
class Student:
name = "Chandu"
age = 22
✅ Example:
python Copy code
s1 = Student()
print([Link])
print([Link])
✅ 3.1 Encapsulation
Encapsulation means binding data and functions together and restricting direct
access.
[Link] 3/39
11/9/25, 10:31 PM Application modification
✅ Example:
python Copy code
class Employee:
def __init__(self, name, salary):
[Link] = name # public
self._department = "IT" # protected
self.__salary = salary # private
✅ 3.2 Abstraction
Abstraction means showing only essential details and hiding complex implementation.
✅ Example:
python Copy code
class Car(ABC):
@abstractmethod
def mileage(self):
pass
class BMW(Car):
def mileage(self):
print("Mileage is 20 kmpl")
[Link] 4/39
11/9/25, 10:31 PM Application modification
c = BMW()
[Link]()
✅ 3.3 Inheritance
Inheritance allows one class (child/subclass) to acquire data and behavior from
another (parent/base class).
class Parent:
def display(self):
print("Parent class")
class Child(Parent):
pass
obj = Child()
[Link]()
class A:
def funA(self):
print("A")
class B:
[Link] 5/39
11/9/25, 10:31 PM Application modification
def funB(self):
print("B")
c = C()
[Link]()
[Link]()
class A:
pass
class B(A):
pass
class C(B):
pass
✅ 3.4 Polymorphism
Polymorphism means one name, many forms.
class Animal:
def sound(self):
print("Some sound")
class Dog(Animal):
def sound(self):
print("Bark")
[Link] 6/39
11/9/25, 10:31 PM Application modification
obj = Dog()
[Link]()
print(add(10, 20))
print(add(10, 20, 30))
✅ 4. Constructor in Python
__init__() is the constructor, called automatically when an object is created.
✅ Example:
python Copy code
class Student:
def __init__(self, name, age):
[Link] = name
[Link] = age
s = Student("Chandu", 22)
print([Link], [Link])
✅ 5. Destructor in Python
__del__() method is used as a destructor, called when object is deleted.
class Test:
def __del__(self):
print("Destructor called")
[Link] 7/39
11/9/25, 10:31 PM Application modification
t = Test()
del t
class Example:
def instance_method(self):
print("Instance method")
class Example:
count = 0
@classmethod
def show_count(cls):
print([Link])
[Link] 8/39
11/9/25, 10:31 PM Application modification
class Math:
@staticmethod
def add(a, b):
return a + b
print([Link](5, 3))
✅ 7. Operator Overloading
Python allows operators to have different meanings depending on object type.
✅ Example:
python Copy code
class Number:
def __init__(self, value):
[Link] = value
n1 = Number(10)
n2 = Number(20)
print(n1 + n2)
__init__() constructor
__len__() length
__add__() + operator
__eq__() == operator
[Link] 9/39
11/9/25, 10:31 PM Application modification
Method Purpose
__del__() destructor
class BankAccount:
def __init__(self, name, balance):
[Link] = name
self.__balance = balance
def get_balance(self):
return self.__balance
✅ Done ✅
If you want, I can also provide:
[Link] 10/39
11/9/25, 10:31 PM Application modification
Decorators
✅ 1. Why Decorators?
They are used to:
def my_decorator(func):
def wrapper():
print("Before function execution")
func()
print("After function execution")
return wrapper
Using decorator:
[Link] 11/39
11/9/25, 10:31 PM Application modification
@my_decorator
def display():
print("Inside function")
display()
@my_decorator
def display():
print("Inside function")
It is equivalent to:
display = my_decorator(display)
✅ Example:
def my_decorator(func):
def wrapper(*args, **kwargs):
print("Before function")
result = func(*args, **kwargs)
print("After function")
return result
return wrapper
@my_decorator
def add(a, b):
[Link] 12/39
11/9/25, 10:31 PM Application modification
return a + b
print(add(10, 20))
✅ Example:
def square_decorator(func):
def wrapper(num):
value = func(num)
return value * value
return wrapper
@square_decorator
def get_number(x):
return x
print(get_number(5)) # Output: 25
def log(func):
def wrapper(*args, **kwargs):
print("Arguments are:", args, kwargs)
return func(*args, **kwargs)
return wrapper
@log
def multiply(a, b):
return a * b
[Link] 13/39
11/9/25, 10:31 PM Application modification
print(multiply(4, 6))
def logger(func):
def wrapper(*args, **kwargs):
print(f"Function {func.__name__} called")
return func(*args, **kwargs)
return wrapper
@logger
def process_data():
print("Processing...")
✅ Authentication Check
python Copy code
def check_login(func):
def wrapper(user):
if user != "admin":
print("Access Denied")
else:
return func(user)
return wrapper
@check_login
def dashboard(user):
print("Welcome Admin!")
dashboard("guest")
dashboard("admin")
[Link] 14/39
11/9/25, 10:31 PM Application modification
✅ Performance Measurement
python Copy code
import time
def timer(func):
def wrapper():
start = [Link]()
func()
end = [Link]()
print("Time taken:", end-start)
return wrapper
@timer
def test():
for _ in range(1000000):
pass
test()
def repeat(n):
def decorator(func):
def wrapper(*args, **kwargs):
for _ in range(n):
func(*args, **kwargs)
return wrapper
return decorator
@repeat(3)
def greet():
print("Hello")
[Link] 15/39
11/9/25, 10:31 PM Application modification
greet()
def my_decorator(func):
@wraps(func)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
return wrapper
✅ Example:
class Decorator:
def __init__(self, func):
[Link] = func
def __call__(self):
print("Before")
[Link]()
print("After")
@Decorator
def show():
print("Inside function")
show()
[Link] 16/39
11/9/25, 10:31 PM Application modification
✅ 11. Use Decorators With Methods
python Copy code
def check_role(func):
def wrapper(self):
if [Link] != "admin":
print("Not allowed")
else:
func(self)
return wrapper
class User:
def __init__(self, role):
[Link] = role
@check_role
def delete_account(self):
print("Account deleted")
u1 = User("guest")
u1.delete_account()
u2 = User("admin")
u2.delete_account()
[Link] 17/39
11/9/25, 10:31 PM Application modification
Sure! Here are very simple, beginner-friendly examples of decorators using small
functions.
def my_decorator(func):
def wrapper():
print("Before function run")
func()
print("After function run")
return wrapper
@my_decorator
def say_hello():
print("Hello World!")
say_hello()
[Link] 18/39
11/9/25, 10:31 PM Application modification
✅ Output:
pgsql Copy code
def my_decorator(func):
def wrapper(name):
print("Calling function...")
func(name)
print("Function executed")
return wrapper
@my_decorator
def greet(name):
print(f"Hello {name}")
greet("Chandu")
✅ Output:
javascript Copy code
Calling function...
Hello Chandu
Function executed
def add_feature(func):
def wrapper():
print("Start")
[Link] 19/39
11/9/25, 10:31 PM Application modification
func()
print("End")
return wrapper
@add_feature
def message():
print("This is a message")
message()
def square_decorator(func):
def wrapper(num):
result = func(num)
return result * result
return wrapper
@square_decorator
def give_number(x):
return x
print(give_number(5)) # Output: 25
def logger(func):
def wrapper():
print("Function is running...")
func()
print("Function finished")
return wrapper
@logger
def demo():
[Link] 20/39
11/9/25, 10:31 PM Application modification
demo()
If you want **examples with user input, numbers, or with *args and kwargs, just tell
me!
in theory wise
Here is a simple, clean, theory-wise explanation of decorators that you can write in
notes or explain in an interview.
✅ Definition
A decorator is a function that takes another function as an argument, adds some
functionality, and returns another function.
✅ Purpose of Decorators
To add additional features to a function
To avoid repeating code
To separate logic cleanly
To maintain the original function but add extra behavior
To follow the DRY (Don’t Repeat Yourself) principle
[Link] 21/39
11/9/25, 10:31 PM Application modification
✅ Syntax of Decorator
python Copy code
@decorator_name
def function_name():
pass
function_name = decorator_name(function_name)
✅ Components of a Decorator
A decorator contains:
✅ Types of Decorators
[Link] 22/39
11/9/25, 10:31 PM Application modification
1. Function decorators
2. Decorators with arguments
3. Multiple decorators
4. Class decorators
✅ Advantages of Decorators
Code reuse
Clean and readable code
Adds extra functionality without modifying original function
Good for logging, authorization, validation, timing, etc.
✅ Common Applications
Logging function calls
Authentication/Authorization
Performance measurement (execution time)
Input/output validation
Debugging
Caching (in Python frameworks)
def decorator(func):
def wrapper():
print("Something before function")
func()
print("Something after function")
return wrapper
@decorator
def display():
print("Hello!")
Here:
[Link] 23/39
11/9/25, 10:31 PM Application modification
If you want, I can prepare 2-mark, 5-mark, or 10-mark answers for exam-purpose
theory!
% → gives remainder
[Link] 24/39
11/9/25, 10:31 PM Application modification
if b != 0:
result = a / b
print("Division =", result)
else:
print("Error: Division by zero is not allowed")
✅ 3. Example Output
sql Copy code
a = 10
b = 3
print(a // b) # Output = 3
a = 10
b = 3
print(a % b) # Output = 1
If you want, I can also give division using functions, without operators, or using try-
except.
[Link] 25/39
11/9/25, 10:31 PM Application modification
by using decorator
✅ Code Example
python Copy code
def safe_division(func):
def wrapper(a, b):
if b == 0:
print("Error: Division by zero is not allowed!")
return None
return func(a, b)
return wrapper
@safe_division
def divide(a, b):
return a / b
# Test
print(divide(10, 2)) # Valid division
print(divide(10, 0)) # Error case
[Link] 26/39
11/9/25, 10:31 PM Application modification
✅ Output
5.0
Error: Division by zero is not allowed!
None
✅ Explanation
The decorator safe_division checks if the denominator ( b ) is zero.
If zero → it prints an error message.
Otherwise → it executes the divide() function normally.
✅ 1. CLASS
A class is a blueprint or template for creating objects.
It defines:
Attributes (variables)
Methods (functions)
✅ Example:
python Copy code
class Student:
name = "Chandu"
age = 22
✅ 2. OBJECT
An object is an instance of a class. It has:
✅ State
✅ Behavior
✅ Identity
✅ Example:
python Copy code
s1 = Student()
print([Link])
print([Link])
✅ 3.1 Encapsulation
Encapsulation means wrapping data (variables) and methods (functions) together,
and controlling access.
[Link] 28/39
11/9/25, 10:31 PM Application modification
Python supports:
✅ Example:
python Copy code
class Employee:
def __init__(self, name, salary):
[Link] = name # public
self._dept = "IT" # protected
self.__salary = salary # private
✅ 3.2 Abstraction
Abstraction means showing only essential details and hiding unnecessary
implementation.
✅ Example:
python Copy code
class Shape(ABC):
@abstractmethod
def area(self):
pass
class Square(Shape):
def area(self):
return 4*4
[Link] 29/39
11/9/25, 10:31 PM Application modification
✅ 3.3 Inheritance
Inheritance allows one class (child) to acquire methods & properties from another
(parent).
✅ Types of Inheritance:
1. Single
2. Multiple
3. Multilevel
4. Hierarchical
5. Hybrid
class A:
def showA(self):
print("A")
class B(A):
pass
obj = B()
[Link]()
class A:
pass
class B(A):
pass
class C(B):
pass
[Link] 30/39
11/9/25, 10:31 PM Application modification
✅ Multiple Inheritance Example:
python Copy code
class A:
pass
class B:
pass
✅ 3.4 Polymorphism
Polymorphism means same function name works differently for different objects.
class Animal:
def sound(self):
print("Sound")
class Dog(Animal):
def sound(self):
print("Bark")
[Link] 31/39
11/9/25, 10:31 PM Application modification
✅ 4. CONSTRUCTOR
Special method created using:
__init__()
✅ Example:
python Copy code
class Student:
def __init__(self, name):
[Link] = name
✅ 5. DESTRUCTOR
Destructor method:
__del__()
[Link] 32/39
11/9/25, 10:31 PM Application modification
class Test:
def show(self):
print("Instance method")
class Test:
x = 10
@classmethod
def display(cls):
print(cls.x)
class Test:
@staticmethod
def add(a, b):
return a + b
Method Purpose
__init__() Constructor
__del__() Destructor
[Link] 33/39
11/9/25, 10:31 PM Application modification
Method Purpose
__len__() Length
class Number:
def __init__(self, value):
[Link] = value
n1 = Number(10)
n2 = Number(20)
print(n1 + n2) # 30
✅ 8. OPERATOR OVERLOADING
Allows operators like + , - , * to work with objects.
✅ 9. CLASS VARIABLES vs INSTANCE VARIABLES
Class Variable Instance Variable
class Test:
class_var = 10 # class variable
class BankAccount:
def __init__(self, name, balance):
[Link] = name
self.__balance = balance # private
def get_balance(self):
return self.__balance
[Link] 35/39
11/9/25, 10:31 PM Application modification
class Vehicle:
def start(self):
print("Starting...")
class Car(Vehicle):
def start(self):
print("Car Starting...")
v = Car()
[Link]()
class Cat:
def sound(self):
print("Meow")
class Dog:
def sound(self):
print("Bark")
class Student:
def __init__(self, name):
self.__name = name
[Link] 36/39
11/9/25, 10:31 PM Application modification
def get_name(self):
return self.__name
class File(ABC):
@abstractmethod
def read(self):
pass
class Logger:
def __init__(self, func):
[Link] = func
def __call__(self):
print("Start")
[Link]()
print("End")
[Link] 37/39
11/9/25, 10:31 PM Application modification
import array
a = [Link]('i', [1, 2, 3, 4, 5])
[Link]()
print(*a)
print(*a)
it unpacks the array elements and prints them individually, separated by spaces.
✅ Without unpacking
If you write:
print(a)
[Link] 38/39
11/9/25, 10:31 PM Application modification
✅ With unpacking ( *a )
python Copy code
print(*a)
Output:
Copy code
5 4 3 2 1
Here:
*a → expands to → 5, 4, 3, 2, 1
print() prints them as separate arguments
[Link] 39/39