Skip to content

Commit 003f0ae

Browse files
committedMay 11, 2020
Update Employee Class.ipynb
1 parent 76ddbaa commit 003f0ae

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed
 

‎Employee Class.ipynb

+21-25
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,19 @@
1111
"text": [
1212
"1.04\n",
1313
"1.04\n",
14-
"1.04\n",
15-
"1.1\n",
16-
"1.1\n",
17-
"1.1\n"
14+
"Soumyadip\n",
15+
"Hello\n"
1816
]
17+
},
18+
{
19+
"data": {
20+
"text/plain": [
21+
"'Soumyadip Chowdhury s.c@python.com 100000'"
22+
]
23+
},
24+
"execution_count": 17,
25+
"metadata": {},
26+
"output_type": "execute_result"
1927
}
2028
],
2129
"source": [
@@ -24,38 +32,26 @@
2432
" no_empl=0;\n",
2533
" raise_amount=1.04\n",
2634
" \n",
27-
" def __init__(self,f ,l ,p ):\n",
28-
" self.first=f\n",
29-
" self.last=l\n",
30-
" self.email=f+\".\"+l+\"@python.com\"\n",
31-
" self.pay=p\n",
35+
" def __init__(self):\n",
36+
" self.first=\"Soumyadip\"\n",
37+
" self.last=\"Chowdhury\"\n",
38+
" self.email=\"s.c@python.com\"\n",
39+
" self.pay=100000\n",
3240
" Employee.no_empl=Employee.no_empl+1\n",
3341
" \n",
3442
" \n",
3543
" def print(self):\n",
44+
" print(\"Hello\")\n",
3645
" return \"{} {} {} {}\".format(self.first,self.last,self.email,self.pay)\n",
3746
" \n",
38-
" def apply_raise(self):\n",
39-
" self.pay=int(self.pay* self.raise_amount)\n",
40-
" ## Can print using class,self and obj name \n",
41-
" \n",
42-
" @classmethod\n",
43-
" def set_raise_amt(cls,amount):\n",
44-
" cls.raise_amount=amount\n",
4547
" \n",
4648
" \n",
47-
"emp_1=Employee(\"Soumyadip\",\"Chowdhury\",900000)\n",
48-
"emp_2=Employee(\"Soumyadip\",\"Chowdhury\",100000)\n",
49-
"\n",
49+
"emp_1=Employee()\n",
5050
"print(Employee.raise_amount)\n",
5151
"print(emp_1.raise_amount)\n",
52-
"print(emp_2.raise_amount)\n",
5352
"\n",
54-
"Employee.set_raise_amt(1.10)\n",
55-
"\n",
56-
"print(Employee.raise_amount)\n",
57-
"print(emp_1.raise_amount)\n",
58-
"print(emp_2.raise_amount)"
53+
"print(emp_1.first)\n",
54+
"emp_1.print()"
5955
]
6056
},
6157
{

0 commit comments

Comments
 (0)
Failed to load comments.