Skip to content

Commit a08d4b4

Browse files
committed
Python course
1 parent c2f66d7 commit a08d4b4

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

PropertyDecorators.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# @property_decorators
2+
# @property_decorators help you to take function as varible
33
class Employee:
44
Name="varinder"
55
Middle="Singh"

README.md

+15-3
Original file line numberDiff line numberDiff line change
@@ -730,8 +730,20 @@
730730
class Employee:
731731
@property
732732
def name(self):
733-
return self.name
733+
return self.Name
734734
data=Employee()
735-
name="varinder"
735+
Name="varinder"
736736
print(data.name)
737-
```
737+
```
738+
739+
# @getter or setter
740+
- Above mention "@property_decotrstor" is called getter who get the value and with help of setter method or decorator you can define a [email protected] like that.
741+
*Example is connected with above one*
742+
```
743+
@name.setter
744+
def name(self,value):
745+
self.name=value
746+
```
747+
748+
# Operator overloading in Python
749+
- Operators can be overloaded by using dunder methods in python.

0 commit comments

Comments
 (0)