MCPcopy Create free account
hub / github.com/CodeWithHarry/The-Ultimate-Python-Course / Employee

Class Employee

Chapter 11/06_property_decorators.py:1–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1class Employee:
2 a = 1
3
4 @classmethod
5 def show(cls):
6 print(f"The class attribute of a is {cls.a}")
7
8 @property
9 def name(self):
10 return f"{self.fname} {self.lname}"
11
12 @name.setter
13 def name (self,value):
14 self.fname = value.split(" ")[0]
15 self.lname = value.split(" ")[1]
16
17e = Employee()
18e.a = 45

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected