We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a08d4b4 commit 61fe5abCopy full SHA for 61fe5ab
PropertyDecorators.py
@@ -2,10 +2,19 @@
2
# @property_decorators help you to take function as varible
3
class Employee:
4
Name="varinder"
5
- Middle="Singh"
6
- Last="Brar"
+ pocktmoney=5004
+ saving=5000
7
@property
8
- def name(self):
9
- return self.Name+" "+self.Middle+" "+self.Last
+ def totalmoney(self):
+ return self.pocktmoney+self.saving
10
+
11
+ @totalmoney.setter
12
+ def totalmoney(self,value):
13
+ self.saving=value-self.pocktmoney
14
data=Employee()
-print(data.name) #here you get value from function write function as proporty
15
+print(data.totalmoney) #here you get value from function write function as proporty
16
+data.totalmoney=9999
17
+print(data.saving)
18
+print(data.totalmoney)
19
+#if you want to set return value according to your need
20
0 commit comments