In [1]:
class Emp:
name ="venkat"
jobtitle="Sales person"
sales=3
def achive (self):
if(self.sales>8):
print("Achived")
else:
print("fail")
In [5]:
emp1=Emp()
emp2=Emp()
In [3]:
emp1.name
Out[3]:
In [6]:
emp2.name
Out[6]:
In [7]:
emp2.sales
Out[7]:
In [8]:
Emp.sales=20
In [9]:
emp2.sales
Out[9]:
In [13]:
emp1.sales
Out[13]:
In [11]:
emp2.sales=15
In [12]:
emp2.sales
Out[12]:
No comments:
Post a Comment