Web
Opt
tools
Instance Attributes Configuration
Class Name
Instance Attributes
Enter instance attributes separated by commas (e.g., name, salary, department)
Attribute Values
Enter values for attributes separated by commas (optional)
Operation
Define Attributes
Access Attributes
Modify Attributes
Delete Attributes
Instance Name
Run Visualization
Console Output
>
Instance Attributes Visualization
Defining Attributes: name, salary
Operation: define
Employee
CONSTRUCTOR
+ __init__(self, name, salary):
self.name = name
self.salary = salary
INSTANCE METHODS
+ get_info(self)
+ update_salary(self, new_salary)
+ calculate_bonus(self, percentage)
Instance: emp1
name
John Doe
salary
50000
Attribute Operations Example
# Creating instance
emp1 = Employee(John Doe, 50000)
# Accessing attributes
print(emp1.name)
print(emp1.salary)
Instance Attributes Characteristics:
Unique to each instance
Defined in __init__ method
Accessed via self.attribute_name
Can be modified after creation
Can be dynamically added/deleted