Skip to content

Commit c4ffae5

Browse files
committed
Employee Print Method
1 parent af932f1 commit c4ffae5

File tree

2 files changed

+58
-7
lines changed

2 files changed

+58
-7
lines changed

Employee Init Method.ipynb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@
4545
"print(emp_2.email)\n",
4646
"print(emp_2.pay )"
4747
]
48-
},
49-
{
50-
"cell_type": "code",
51-
"execution_count": null,
52-
"metadata": {},
53-
"outputs": [],
54-
"source": []
5548
}
5649
],
5750
"metadata": {

Employee Print Object.ipynb

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 13,
6+
"metadata": {},
7+
"outputs": [
8+
{
9+
"name": "stdout",
10+
"output_type": "stream",
11+
"text": [
12+
"Soumyadip Chowdhury [email protected] 900000\n",
13+
"Soumyadip Chowdhury [email protected] 100000\n"
14+
]
15+
}
16+
],
17+
"source": [
18+
"class Employee:\n",
19+
" \n",
20+
" def __init__(self,f ,l ,p ):\n",
21+
" self.first=f\n",
22+
" self.last=l\n",
23+
" self.email=f+\".\"+l+\"@python.com\"\n",
24+
" self.pay=p\n",
25+
" \n",
26+
" def print(self):\n",
27+
" return \"{} {} {} {}\".format(self.first,self.last,self.email,self.pay)\n",
28+
" \n",
29+
" \n",
30+
"emp_1=Employee(\"Soumyadip\",\"Chowdhury\",900000)\n",
31+
"emp_2=Employee(\"Soumyadip\",\"Chowdhury\",100000)\n",
32+
"print(emp_1.print())\n",
33+
"print(emp_2.print())"
34+
]
35+
}
36+
],
37+
"metadata": {
38+
"kernelspec": {
39+
"display_name": "Python 3",
40+
"language": "python",
41+
"name": "python3"
42+
},
43+
"language_info": {
44+
"codemirror_mode": {
45+
"name": "ipython",
46+
"version": 3
47+
},
48+
"file_extension": ".py",
49+
"mimetype": "text/x-python",
50+
"name": "python",
51+
"nbconvert_exporter": "python",
52+
"pygments_lexer": "ipython3",
53+
"version": "3.7.4"
54+
}
55+
},
56+
"nbformat": 4,
57+
"nbformat_minor": 4
58+
}

0 commit comments

Comments
 (0)