Skip to content

Commit 1f8d6f6

Browse files
committed
Class Variable
1 parent 6f799a1 commit 1f8d6f6

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

Employee Class Variable.ipynb

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

0 commit comments

Comments
 (0)