|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "code", |
| 5 | + "execution_count": 29, |
| 6 | + "metadata": {}, |
| 7 | + "outputs": [ |
| 8 | + { |
| 9 | + "name": "stdout", |
| 10 | + "output_type": "stream", |
| 11 | + "text": [ |
| 12 | + "<__main__.Employee object at 0x0000020E598AEE88>\n", |
| 13 | + "Soumyadip\n", |
| 14 | + "Chowdhury\n", |
| 15 | + |
| 16 | + "900000\n", |
| 17 | + "<__main__.Employee object at 0x0000020E598AE108>\n", |
| 18 | + "Soumyadip\n", |
| 19 | + "Chowdhury\n", |
| 20 | + |
| 21 | + "100000\n" |
| 22 | + ] |
| 23 | + } |
| 24 | + ], |
| 25 | + "source": [ |
| 26 | + "class Employee:\n", |
| 27 | + " \n", |
| 28 | + " def __init__(self,f ,l ,p ):\n", |
| 29 | + " self.first=f\n", |
| 30 | + " self.last=l\n", |
| 31 | + " self.email=f+\".\"+l+\"@python.com\"\n", |
| 32 | + " self.pay=p\n", |
| 33 | + " \n", |
| 34 | + " \n", |
| 35 | + "emp_1=Employee(\"Soumyadip\",\"Chowdhury\",900000)\n", |
| 36 | + "emp_2=Employee(\"Soumyadip\",\"Chowdhury\",100000)\n", |
| 37 | + "print(emp_1)\n", |
| 38 | + "print(emp_1.first)\n", |
| 39 | + "print(emp_1.last)\n", |
| 40 | + "print(emp_1.email)\n", |
| 41 | + "print(emp_1.pay )\n", |
| 42 | + "print(emp_2)\n", |
| 43 | + "print(emp_2.first)\n", |
| 44 | + "print(emp_2.last)\n", |
| 45 | + "print(emp_2.email)\n", |
| 46 | + "print(emp_2.pay )" |
| 47 | + ] |
| 48 | + }, |
| 49 | + { |
| 50 | + "cell_type": "code", |
| 51 | + "execution_count": null, |
| 52 | + "metadata": {}, |
| 53 | + "outputs": [], |
| 54 | + "source": [] |
| 55 | + } |
| 56 | + ], |
| 57 | + "metadata": { |
| 58 | + "kernelspec": { |
| 59 | + "display_name": "Python 3", |
| 60 | + "language": "python", |
| 61 | + "name": "python3" |
| 62 | + }, |
| 63 | + "language_info": { |
| 64 | + "codemirror_mode": { |
| 65 | + "name": "ipython", |
| 66 | + "version": 3 |
| 67 | + }, |
| 68 | + "file_extension": ".py", |
| 69 | + "mimetype": "text/x-python", |
| 70 | + "name": "python", |
| 71 | + "nbconvert_exporter": "python", |
| 72 | + "pygments_lexer": "ipython3", |
| 73 | + "version": "3.7.4" |
| 74 | + } |
| 75 | + }, |
| 76 | + "nbformat": 4, |
| 77 | + "nbformat_minor": 4 |
| 78 | +} |
0 commit comments